Decipher electrical junction
I do believe this is a switch loop with the supply going to the box. I think Xb, Yb, A2, B2 is the hot supply leg and going to additional lighting or some outlets. Xw, A1 B1 and to the light is the neutral. Yw is the return from the switch (romex Y caries hot to the switch and the white returns the hot to the light when turned on. If this matches what you have the light fixture is wired backwards  and the Yw wire should be marked with tape, marker or paint (I like red for a switched leg but black is normal).