Weight gain and irregular periods

Can you miss periods if you gradually gain weight??