Power of Two Check

MEDIUM-HARD · C · 3000ms

The robot's memory allocator only works efficiently on power-of-two block sizes, so Nusrat needs an instant check for whether a requested size is a power of two. Read N. Print "YES" if N is a power of two (1,2,4,8,...), else "NO". Solve using the bit trick N & (N-1) == 0, in O(1).

Input

One integer N.

Output

"YES" or "NO".

Constraints

1 ≤ N ≤ 10^18

Sample Input

64

Sample Output

YES
main.c
Loading editor…

Write C, then Run (custom I/O) or Submit (sample tests). ⌘/Ctrl+Enter submits.

Power of Two Check · DIU ContestHub