Inherited from Ottoman Turkish یاس (yâs), ultimately from Proto-Turkic *yās (“loss, damage; shame”) (see there for cognates). The semantic development may have been influenced by unrelated Arabic يَأْس (yaʔs, “despair”), whence also the borrowing yeis.