Public Judge

pjudge

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 100
Estadísticas

Given a positive integer $n$, construct a permutation $a_0, \ldots, a_{n-1}$ of $0 \sim n-1$ such that the sequence $b_0, \ldots, b_{n-1}$ defined by $b_i := |a_i - i|$ is also a permutation of $0 \sim n-1$. If no such permutation exists, determine that it is impossible.

Input

A single line containing a positive integer $n$.

Output

If no solution exists, output a single line containing the string NO.

Otherwise, output YES on the first line, and on the second line, output $n$ non-negative integers $a_0, \ldots, a_{n-1}$ representing the constructed permutation $a$.

If there are multiple solutions, you may output any one of them.

Examples

Input 1

1

Output 1

YES
0

Input 2

3

Output 2

NO

Input 3

4

Output 3

YES
3 0 2 1

Constraints

There are 25 test cases in total, each worth 4 points. For all test cases, $n \le 10^6$.

  • For test cases $1 \sim 7$, $n$ are $114514, 206669, 265720, 324765, 620012, 797161, 974304$ respectively.
  • For test cases $8 \sim 10$, $n \equiv 0 \pmod{12}$.
  • For test cases $11 \sim 13$, $n \equiv 1 \pmod{12}$.
  • For test cases $14 \sim 16$, $n \equiv 4 \pmod{12}$.
  • For test cases $17 \sim 19$, $n \equiv 5 \pmod{12}$.
  • For test cases $20 \sim 22$, $n \equiv 8 \pmod{12}$.
  • For test cases $23 \sim 25$, $n \equiv 9 \pmod{12}$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.