php alice consecutive stones

A and B are playing a game of stones. A start always the game.
They will pick in turns 2 consecutive stones from a line until there are no consecutive stones –> condition1: stone i and stone i+1, where 1 ≤ i ≤ N−1

The line has N stones and are indexed from 1 to N. Condition2: N (1 ≤ N ≤ 10 000 000)