You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a line of coins with N(no more than 1000) coins. Two players I and II alternately takes away coins. In each turn one must take away one coin or two adjacent coins. The one who cannot make a move loses.
You are to determine for a given N, whether I will win or II will win, i.e. N is a N-position(next-player-will-win) or P-position(previous-player-will-win).
Input
Every test case is an N described above. Total test case is no more than 50. Process until the first negative number.
Output
If N is a N-position, output a string “Yes” in a line, else “No” in a line.