No.1465 Archaea
タグ : / 解いたユーザー数 170
作問者 :
wolgnik
/ テスター :
Problem Statement
The highly anticipated and hugely popular smartphone game "Archaea" was released just the other day.
"Archaea" is a hyper-sensory rhythm breeding game in which you multiply bacteria by tapping the screen in rhythm. In the initial state of the game, there is only 1 bacterium. You may perform the following 2 types of operations up to $K$ times in total. It is also possible to perform no operations at all.
・Multiply the bacteria. The number of bacteria doubles. That is, for example, if you multiply the bacteria when there are $M$ of them ($M$ is a positive integer), the number of bacteria becomes $2M$.
・Bring in bacteria. The number of bacteria increases by 3. That is, for example, if you bring in bacteria when there are $M$ of them ($M$ is a positive integer), the number of bacteria becomes $M+3$.
Print YES if the number of bacteria can finally be made $N$ by performing operations up to $K$ times from the initial state, and NO otherwise.
Input
$N\ K$
$1 \leq N, K \leq 2 \times 10^5$
All inputs are integers.
All test cases satisfy these constraints.
Output
Print YES if the number of bacteria can finally be made $N$, and NO otherwise, on one line. Also, print a newline at the end.
Sample
Sample 1
Input
14 5
Output
YES
For example, you can multiply the bacteria 3 times and then bring in bacteria 2 times.
Sample 2
Input
6 1
Output
NO
Sample 3
Input
777 777
Output
NO
Sample 4
Input
131 8
Output
YES
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。