Let $X$ be a compact Riemann surface, i.e. compact smooth complex analytic (hence automatically algebraic) curve. Let $A\subset X$ be a finite subset, and $X_0:=X\backslash A$.

Let $Y_0$ be a smooth complex analytic curve (necessarily non-compact) with a holomorphic map $f_0\colon Y_0\to X_0$ which is a finite covering.

**QUESTION.** Do there exist a compact smooth complex analytic (hence algebraic) curve $Y$, a finite subset $B\subset Y$, and a holomorphic (hence in fact algebraic) map $f\colon Y\to X$ such that $Y_0=Y\backslash B$, and $f|_{Y_0}=f_0$?

If yes, a reference would be helpful.