#include <bits/stdc++.h>
using namespace std;
long long int expMod(long long base, long long exp, long long m) {
  if (exp == 0)
    return 1;
  else if (exp == 1)
    return base;
  long long ret = expMod(base, exp / 2, m);
  ret = (ret * ret) % m;
  if (exp % 2) ret = (ret * base) % m;
  return ret;
}
long long inv(long long a, long long m) { return expMod(a, m - 2, m); }
int main() {
  long long int N;
  cin >> N;
  if (N == 1) {
    cout << "YES" << endl;
    cout << 1 << endl;
    return 0;
  } else if (N == 4) {
    cout << "YES" << endl;
    cout << "1" << endl << 3 << endl << 2 << endl << 4 << endl;
    return 0;
  } else {
    for (int i = 2; i < N; i++)
      if (N % i == 0) {
        cout << "NO" << endl;
        return 0;
      }
    cout << "YES" << endl;
    cout << 1 << endl;
    for (long long int i = 2; i < N; i++)
      cout << (((i) * (inv(i - 1, N)) % N)) << endl;
    cout << N << endl;
  }
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

Consider a sequence [a1, a2, ... , an]. Define its prefix product sequence <image>.

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 ≤ 105).

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 ai. 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.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long int expMod(long long base, long long exp, long long m) {
  if (exp == 0)
    return 1;
  else if (exp == 1)
    return base;
  long long ret = expMod(base, exp / 2, m);
  ret = (ret * ret) % m;
  if (exp % 2) ret = (ret * base) % m;
  return ret;
}
long long inv(long long a, long long m) { return expMod(a, m - 2, m); }
int main() {
  long long int N;
  cin >> N;
  if (N == 1) {
    cout << "YES" << endl;
    cout << 1 << endl;
    return 0;
  } else if (N == 4) {
    cout << "YES" << endl;
    cout << "1" << endl << 3 << endl << 2 << endl << 4 << endl;
    return 0;
  } else {
    for (int i = 2; i < N; i++)
      if (N % i == 0) {
        cout << "NO" << endl;
        return 0;
      }
    cout << "YES" << endl;
    cout << 1 << endl;
    for (long long int i = 2; i < N; i++)
      cout << (((i) * (inv(i - 1, N)) % N)) << endl;
    cout << N << endl;
  }
  return 0;
}

```