A new characterization of Hilbert spaces