For a real valued periodic smooth function u on R, n ≥ 0, one defines the osculating polynomial φs (of order 2n + 1) at a point s ∈ R to be the unique trigonometric polynomial of degree n, whose value and first 2n derivatives at s coincide with those of u at s. We will say that a point s is a clean maximal flex (resp. clean minimal flex) of the function u on S1 if and only if φs ≥ u (resp. φs ≤ u) and the preimage (φ - u)-1(0) is connected. We prove that any smooth periodic function u has at least n + 1 clean maximal flexes of order 2n + 1 and at least n + 1 clean minimal flexes of order 2n + 1. The assertion is clearly reminiscent of Morse theory and generalizes the classical four vertex theorem for convex plane curves.