No.8041 Flower Fortune-Telling of Something
Problem Statement
There is $1$ flower with $N$ petals. Kanna and Miyata use this flower to play a game similar to flower fortune-telling.
Kanna moves first, and the two players take turns pulling $1\sim3$ petals from the flower.
After the first petal, that is, $1$ petal, is pulled, the state is "like"; after the $2$nd petal is pulled, it is "dislike"; after the $3$rd petal is pulled, it is "like";
and so on. In this way, each time $1$ petal is pulled, the state alternates between "like" and "dislike", starting from "like".
The outcome is decided as follows: if the state is "like" after the last petal is pulled, the player who pulled last wins; if it is "dislike", the player who pulled last loses.
Given the number of petals $N$ at the start of the game, print Yes if Kanna, who moves first, can win when both players play optimally, and print No otherwise.
Input
$N$
Output
Yes or No
Print a newline at the end.
Sample
Sample 1
Input
7
Output
Yes
If Kanna pulls $3$ petals on the first move, the state goes $\to$ "like" $\to$ "dislike" $\to$ "like", and $4$ petals remain.
Then, no matter how Miyata pulls from the remaining $4$ petals, Kanna can pull all the remaining petals next, so the state goes $\to$ "dislike" $\to$ "like" $\to$ "dislike" $\to$ "like",
and Kanna can win.
Sample 2
Input
724
Output
Yes
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
iwkjosec