A new characterization of inner product spaces