Let be $M$,$N$ and $X$ compact riemann surfaces, $f:M\to N$ an holomorphic map with ramifications points $\{p_1,\ldots,p_r\}$ with multiplicities $m_1,\ldots,m_r$ and, $g:X\to N$ holomorphic maps $\{q_1,\ldots,q_s\}$ with multiplicities $n_1,\ldots,n_s$. Now, let be $Y\subset M\times X,~~~Y=\{(z,x)\in M\times X |~~f(z)=g(x) \}$
My question: When $Y$ is a smooth riemann surface?