Bit Component
시간 제한1초메모리 제한2048 MB
1부터 n까지의 수를 오른쪽 정렬한 이진수 행으로 적을 때 1 비트가 변으로 이어진 한 영역을 이루도록 순서를 정할 수 있는지 판정하고, 가능하면 그 순서를 출력한다.
문제
Denis really likes binary representation of numbers. Once he wrote down binary representations of numbers from to , in some order, one under the other, so that their rightmost digits were aligned. Then he realized that the ones in these numbers form a single connected region: if we consider the places for digits as squares on a grid, all squares containing ones are connected by sides. Now he wonders if the same thing can be done for numbers from to for different .
You are given an integer . You should find a good permutation of all integers from to , or determine that there is no such permutation. A permutation is good if, when we write the numbers down as described above, the ones form a single connected region.
입력
The only line contains a single integer ().
출력
If there is no good permutation of numbers from to , print a single line with the word "NO" (uppercase). Otherwise, print a line with the word "YES" (uppercase), and then another line containing the good permutation you found. If there are several possible answers, print any one of them.
힌트

Third example