check gameover condition for the top row