#arc138d. [arc138_d]Differ by K bits
[arc138_d]Differ by K bits
Problem Statement
You are given integers and . Determine whether there exists a permutation of satisfying the condition below, and construct one such sequence if it exists. Note that is -indexed.
- For every (), and differ by exactly bits in binary representation. The comparison is made after zero-padding both integers to bits.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If there is no satisfying the condition, print No
. If there is such a , print it in the following format:
Yes
If there are multiple solutions satisfying the condition, printing any of them will be accepted.
Sample Input 1
3 1
Sample Output 1
Yes
0 1 3 2 6 7 5 4
Here, we have in binary representation.
We can see that and , for example, differ by exactly bit, satisfying the condition for . The same goes for every .
Sample Input 2
2 2
Sample Output 2
No