#P4653. Flea travel

    ID: 2220 传统题 1000ms 256MiB 尝试: 1 已通过: 1 难度: 10 上传者: 标签>基础算法模拟数学语言入门数组CodeForces

Flea travel

Flea travel

题面翻译

一个虫子位于绕城一圈的nn片树叶中的一片上,在第kk分钟,虫子会跳过k1k-1片树叶并在脚下的树叶上做一个记号。在这里,我们假设虫子的life=+life=+∞。你的任务是判断该虫子是否将nn片树叶都做了记号。

输入格式:

只有一行,一个数字nn,为树叶总数量。

输出格式:

若将nn片树叶都做了记号,输出YESYES。否则,输出NONO

Translated by @da32s1da

题目描述

A flea is sitting at one of the n n hassocks, arranged in a circle, at the moment. After minute number k k the flea jumps through k1 k-1 hassoсks (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.

输入格式

The only line contains single integer: 1<=n<=1000 1<=n<=1000 — number of hassocks.

输出格式

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

样例 #1

样例输入 #1

1

样例输出 #1

YES

样例 #2

样例输入 #2

3

样例输出 #2

NO