by 1889, American English, variant of yes or yeah, altered for emphasis, or possibly influenced by nope.
Entries linking to yep
yes adv.
Old English gise, gese "so be it!," probably from gea, ge "so" (see yea) + si "be it!," from Proto-Germanic *sijai-, from PIE *si-, optative stem of root *es- "to be." Originally stronger than simple yea. Used in Shakespeare mainly as an answer to negative questions. As a noun from 1712. Yes-man is first recorded 1912, American English.
nope adv.
1888, emphatic form of no, with emphasis on the closing of the lips.