Game With Board

Two players play a game on an M x N board. A token starts at the top-left cell (0, 0). On each turn, a player must move the token either one step down or one step right. The player who moves the token to the bottom-right cell (M-1, N-1) wins the game.

Both players play optimally. Given M and N as a 2-element array [M, N], determine which player wins. Return 1 if the first player wins, and 2 if the second player wins.

Examples
Input: [1,1]
Output: 1
Hints

Game With Board

Two players play a game on an M x N board. A token starts at the top-left cell (0, 0). On each turn, a player must move the token either one step down or one step right. The player who moves the token to the bottom-right cell (M-1, N-1) wins the game.