Y is group 2 metals, it will donate two electrons. then it will form cation with 2+ charge.
when oxygen react will metals, it will gain two electrons. and form 2- charge.
due to oxygen gain two electrons form one Y metal. so the formula is YO.
And the bonding of it is ionic bond