Staircase Nim

There are n piles arranged on stairs (pile 1 on step 1, pile 2 on step 2, etc.). A move consists of moving any positive number of stones from a pile on step i to step i-1. Stones reaching step 0 are removed from the game. The player who makes the last move wins. Determine if the first player has a winning strategy.

Stones sit on numbered steps and a move pushes any positive number of stones from step i down to step i - 1. Stones that reach step zero leave the game, and the player who makes the last move wins.

The key observation is that stones on even steps are irrelevant. A move from an even step can be mirrored by pushing the same stones one step further down, so even steps never change who wins. Only odd steps behave like independent Nim piles, because a move between two odd steps lands on an even step and can always be answered. XOR the pile sizes on steps 1, 3, 5, and so on. A non-zero XOR means the first player wins, and a zero XOR means the second player wins.

Examples
Input: [3,2,1]
Output: true
Hints

Staircase Nim

There are `n` piles arranged on stairs (pile 1 on step 1, pile 2 on step 2, etc.). A move consists of moving any positive number of stones from a pile on step `i` to step `i-1`. Stones reaching step 0 are removed from the game. The player who makes the last move wins. Determine if the first player has a winning strategy.