Earliest recorded usage in America is from the late 1880s, followed in the early 1890s by yep. My guess is that the plosive 'p' sounds more final and definite than the 's' of yes or the vowel-ending of no. In other words, the suggestion is "No way!" and "Certainly!"