A conformal characterization of manifolds of constant sectional curvature