Global periodicity and complete integrability of discrete dynamical systems