시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB19161392.857%

문제

Suppose you have a non-negative integer $x$. You can do two types of operations:

  1. $x := x \textrm{ AND } 2x$;
  2. $x := x \textrm{ OR } 2x$;

where \textrm{AND} and \textrm{OR} are the bitwise AND and bitwise OR operations, respectively.

You are given three integers $N$, $A$, and $B$.

If the value of $x$ is initially $N$, is there any sequence of operations that consists of exactly $A$ operations of type 1 and exactly $B$ operations of type 2, such that the final value of $x$ is $N \cdot 2^k$ for some non-negative integer $k$?

입력

Input consists of three integers $N$, $A$, and $B$ ($1 \leq N \leq 10^{18}$, $0 \leq A, B \leq 10^{18}$, $A + B \geq 1$).

출력

Output a single line containing YES if it is possible to make the final value of $x$ equal to $N \cdot 2^k$ where $k$ is a non-negative integer, or NO otherwise.

예제 입력 1

14 2 2

예제 출력 1

YES

Explanation of Sample 1: Initially, $x = 14$. You can do the following sequence of operations:

  1. Do a type 1 operation. $x = 14 \textrm{ AND } 28 = 12$.
  2. Do a type 1 operation. $x = 12 \textrm{ AND } 24 = 8$.
  3. Do a type 2 operation. $x = 8 \textrm{ OR } 16 = 24$.
  4. Do a type 2 operation. $x = 24 \textrm{ OR } 48 = 56$.

The final value of $x$ is $56 = 14 \cdot 2^2$.

예제 입력 2

1 0 9

예제 출력 2

NO