When n=1 they are elliptic curves, so the answer is no.
When n>1, then $Y$ and $X$ have dimension at least 3. By the Lefschetz hyperplane theorem for $X$, we have $\mathrm{Pic}(X) \cong \mathbb{Z}$. As the codimension of $Y\setminus U$ is 2 we have $\mathrm{Pic}(Y) \cong \mathrm{Pic}(U)$ and the latter is a quotient of $\mathrm{Pic}(X)$ (by excision for the inclusion $U\subset X$). As $Y$ is projective, $\mathrm{Pic}(Y) \cong \mathbb{Z}$. As $\mathrm{Pic}(U) \cong \mathbb{Z}$, then again by excision the codimension of $X\setminus U$ in $X$ is at least 2.
The pullback of the ample generator ($\mathcal{O}_X(1)$) of $\mathrm{Pic}(X)$ to $U$ extends to the ample generator $L$ of $\mathrm{Pic}(Y)$. By Hartog's extension type results: $H^0(Y,L^{\otimes m})\cong H^0(U,L^{\otimes m}|_U)
\cong H^0(X,\mathcal{O}_X(m))$. As some power is very ample, it follows that $Y \cong X$.
So for any $n$, the answer is no.