A/an is determined by the pronunciation of the first letter, not the letter
itself. In this case it is the consonantal "y" that begins the word so it
is "a" like in "a yo-yo". (This also leads to the similar confusion with
"an historic" being allowed  since the "h" is basically silently when these
are said together.)