Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
E. Prefix Product Sequence

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputConsider a sequence [*a*_{1}, *a*_{2}, ... , *a*_{n}]. Define its prefix product sequence .

Now given *n*, find a permutation of [1, 2, ..., *n*], such that its prefix product sequence is a permutation of [0, 1, ..., *n* - 1].

Input

The only input line contains an integer *n* (1 ≤ *n* ≤ 10^{5}).

Output

In the first output line, print "YES" if such sequence exists, or print "NO" if no such sequence exists.

If any solution exists, you should output *n* more lines. *i*-th line contains only an integer *a*_{i}. The elements of the sequence should be different positive integers no larger than *n*.

If there are multiple solutions, you are allowed to print any of them.

Examples

Input

7

Output

YES

1

4

3

6

5

2

7

Input

6

Output

NO

Note

For the second sample, there are no valid sequences.

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/13/2021 15:49:24 (i1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|