  In this paper, we introduce modular polynomials for the congruence subgroup
$\Gamma_0(M)$ when $ X_0(M) $ has genus zero and therefore the polynomials are
defined by a Hauptmodul of $ X_0(M) $. We show that the intersection number of
two curves defined by two modular polynomials can be expressed as the sum of
the numbers of $\mathrm{SL}_2(\mathbb{Z})$-equivalence classes of positive
definite binary quadratic forms over $\mathbb{Z}$. We also show that the
intersection numbers can be also combinatorially written by Fourier
coefficients of the Siegel Eisenstein series of degree 2, weight 2 with respect
to $\mathrm{Sp}_2(\mathbb{Z})$.
