P15664 [ICPC 2025 Jakarta R] AND and/or OR

Description

Suppose you have a non-negative integer $x$. You can do two types of operations: - $x := x \textrm{ AND } 2x$; - $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 $\textbf{exactly}$ $A$ operations of type 1 and $\textbf{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 Format

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 Format

Output a single line containing $\texttt{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 $\texttt{NO}$ otherwise.

Explanation/Hint

$\textit{Explanation of Sample 1:}$ Initially, $x = 14$. You can do the following sequence of operations: - Do a type 1 operation. $x = 14 \textrm{ AND } 28 = 12$. - Do a type 1 operation. $x = 12 \textrm{ AND } 24 = 8$. - Do a type 2 operation. $x = 8 \textrm{ OR } 16 = 24$. - Do a type 2 operation. $x = 24 \textrm{ OR } 48 = 56$. The final value of $x$ is $56 = 14 \cdot 2^2$.