Miser NIM Game

Ans = Player1 if (XOR of piles !=0 && All_tiles_are_not_equal_to_1)
           or if (XOR of piles ==0 && All_tiles_are_equal_to_1)
    = Player2 otherwise