Codeforces Round 760 (Div. 3) |
---|
Finished |
You are given two positive integers $$$x$$$ and $$$y$$$. You can perform the following operation with $$$x$$$: write it in its binary form without leading zeros, add $$$0$$$ or $$$1$$$ to the right of it, reverse the binary form and turn it into a decimal number which is assigned as the new value of $$$x$$$.
For example:
Your task is to find out whether $$$x$$$ can be turned into $$$y$$$ after a certain number of operations (possibly zero).
The only line of the input contains two integers $$$x$$$ and $$$y$$$ ($$$1 \le x, y \le 10^{18}$$$).
Print YES if you can make $$$x$$$ equal to $$$y$$$ and NO if you can't.
3 3
YES
7 4
NO
2 8
NO
34 69
YES
8935891487501725 71487131900013807
YES
In the first example, you don't even need to do anything.
The fourth example is described in the statement.
Name |
---|