Solution (source code)

= Solution

Set
$$
m_N=\mathbb EY_N=\frac1N\sum_{k=1}^N\mathbb EX_k.
$$
By <variance additivity for independent random variables>,
$$
\lVert Y_N-m_N\rVert_2^2
=\operatorname{Var}(Y_N)
=\frac1{N^2}\sum_{k=1}^N\operatorname{Var}(X_k)
\leq\frac1N\longrightarrow0.
$$
Thus $Y_N$ differs in $L^2$ by $o(1)$ from the deterministic scalar $m_N$. The <L2 convergence of averages of independent variables with bounded second moments> gives the necessary and sufficient condition
$$
\boxed{
Y_N\text{ converges in }L^2
\Longleftrightarrow
\frac1N\sum_{k=1}^N\mathbb EX_k
\text{ converges}.}
$$