Physiological and psychological arousal or energization affects the efficiency of behavior in an inverted-U fashion: as arousal increases, behavioral efficiency increases, levels off, and then decreases. According to the Yerkes-Dodson law, behavioral efficiency is best when easy tasks are performed with high arousal but also when difficult tasks are performed with low arousal. Stimulus novelty, complexity, and incongruity determine the affective valence of arousal: unpleasant or pleasant. According to optimal level of stimulation theory, when the arousal stimuli produce is too low or too high, valence is unpleasant. But when arousal is moderate or optimal, then valence is pleasant. Mildly discrepant, incongruous, or deviant musical notes or punchlines are enjoyed provided the notes and punchlines are resolved—that is, assimilated into the music or joke stem schema.