408841: GYM103348 C Juliet's Garden

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Juliet's Gardentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Juliet is anxiously waiting for Romeo to return to Verona so they can go get married. She has a garden with $$$n$$$ flower beds arranged in a circle. She starts at the flower bed $$$1$$$ and starts walking clockwise around the circle at an ever-increasing pace. If she is currently at flower bed $$$c$$$ at the start of minute $$$i$$$, by the end of that minute she will briefly stop and rest at flower bed $$$c + i$$$ and then immediately continue walking from that point at the start of the minute $$$i + 1$$$ (i.e. by the end of minute $$$1$$$ she stops and rests at flower bed $$$2$$$ and then at the start of minute $$$2$$$ she starts walking and at the end of minute $$$2$$$ she has stopped and rested at flower bed $$$4$$$). Flower bed $$$n$$$ is followed by flower bed $$$1$$$ in the circle.

Juliet could be waiting for an infinitely long amount of time because she hasn't heard at all from Romeo so the Nurse is curious if Juliet will end up stopping and resting at all the $$$n$$$ flower beds in the circle during her walk.

Input

The input is a single line containing a single integer $$$n$$$ ($$$1 \leq n \leq 10^{4}$$$) representing the number of unique flower beds within Juliet's garden.

Output

Output YES if Juliet will ever stop and rest at all the flower beds in her garden while waiting for Romeo and NO otherwise.

ExamplesInput
2
Output
YES
Input
3
Output
NO

加入题单

上一题 下一题 算法标签: