Sleep is composed of two stages: REM (Rapid Eye Movement) and non-REM. The former helps in mental consolidation while the…