Note: Perhaps a univerbation in Middle English of the interjection ahah entry 1 and the affirmative yeyea entry 1 with shift of stress; however, Middle English evidence for such a phrase is lacking.
Middle English ay, borrowed from Old Norse ei, ey, æ "ever, forever," going back to Germanic *aiwim or *aiwom (whence also Old English ā "always, ever, eternally," Old Saxon io, eo "ever, at any time, always," Old High German io, eo "on every occasion, always," Gothic ni … aiw "never"), accusative forms, used adverbially, of *aiwis or *aiwos "time, eternity" (whence Old Frisian ēwe "eternity," Old Saxon and Old High German ēwa, Middle Dutch ēwe, ee "age, eternity"), going back to Indo-European *h2ei̯-u̯o- "eternity, age," whence also Latin aevus, aevum "time as the medium in which events occur, age, lifetime"; also, from a stem h2ei̯-u̯-on-, Greek aiṓn "lifetime, long period of time, age"; and from a u-stem with ablaut and shifting stress *h2ói̯-u-, *h2i̯-éu̯-s, Sanskrit ā́yuḥ "vital force," Avestan āiiu (nominative), yaoš (genitive) "lifetime"
Note: In Middle English the outcome of the Old Norse word has fallen together with the outcome of Old English -æg (as in dæg "day"). Old English ā continued into Middle English as o, oo, and the two words may occur combined as "(for) ay and oo," meaning "forever." For incorporation of ā into compounds in Old English see aught entry 1, no entry 1, naught entry 1, each entry 1. Overlapping in formation with this Germanic etymon is a homonymous root evident in Old English ǣ "law, marriage," Old Frisian ē, ēwe, iōwe "law," Old Saxon ēo, ēu, Old High German ēwa, ēwī "law, command, covenant" (see echt). The two roots have been taken by some as identical, with the sense "law" a concretization of the sense "what lasts, what always exists."