2744.Flea travel

Time Limit: 1s Memory Limit: 256MB

A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k-1 hassocks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should answer: will the flea visit all the hassocks or not. We assume that flea has infinitely much time for this jumping.

Input Format(From the terminal/stdin)

The only line contains single integer: 1 \le n \le 1000 - number of hassocks.

Output Format(To the terminal/stdout)

Output "YES" if all the hassocks will be visited and "NO" otherwise.

Sample Input 1

Copy
1
 \n

Sample Output 1

Copy
YES
   \n

Sample Input 2

Copy
3
 \n

Sample Output 2

Copy
NO
  \n

Submit

请先 登录

© 2025 FAQs