network theory – Probability distribution in Erdos-Rényi graph

Is this correct formula to calculate the probability for having exactly $M$ links in an Erdos-Rényi graph with $N$ nodes and $p$ linking probability?

$p(M)=binom{frac{N(N-1)}{2}}{M}p^M(1-p)^{frac{N(N-1)}{2}-M}$

If not, how it should be calculated?