Some people do get headaches from the flashes of light or it can even trigger migraines for some people. It's not necessarily "damage" that does this but it's the repeated pulse of the laser that it triggers headaches.
Separately, unless the yag was directly shot into the eye, it doesn't affect the eye. (Assuming of course you were wearing proper eye wear?) And no matter what, yag lasers only penetrate into upper skin layers so under no circumstances was your brain affected in any way.