Could you help me solve this problem?
Let $e_1, e_2, ...$ be an orthonormal system in a Hilbert space, $\delta_1, \delta_2 ... \in (0, + \infty)$. Prove that the set of all vectors $\sum _{n=1} ^{\infty} \lambda_n e_n, \ \ \lambda_n \in \mathbb{C}, \ \ |\lambda_n| \le \delta_n \ \ \forall n \in \mathbb{N}$ is compact $\iff$ $\sum_{n=1} ^{\infty}\delta_n^2$ is convergent.