On the entangled ergodic theorem