An ergodic theorem for sequences in a Hilbert space