| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 21 | 6 | 6 | 30.000% |
Denis really likes binary representation of numbers. Once he wrote down binary representations of numbers from 1ドル$ to 7ドル,ドル 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 1ドル$ to $n$ for different $n$.
You are given an integer $n$. You should find a good permutation of all integers from 1ドル$ to $n,ドル 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 $n$ (1ドル \leq n \leq 2 \cdot 10^5$).
If there is no good permutation of numbers from 1ドル$ to $n,ドル 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.
1
YES 1
2
NO
3
YES 2 3 1
Third example