#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxpq = priority_queue<T>;
inline long long CC(long long n, long long y) {
  return (((n) + (y - 1) - 1) / (y - 1)) - (((n) + (y)-1) / (y));
}
inline long long FF(long long n, long long y) { return n / y - n / (y + 1); }
inline int add(int a, int b, int p = 1000000007) {
  int c = a + b;
  if (c >= p) c -= p;
  return c;
}
inline int sub(int a, int b, int p = 1000000007) {
  int c = a - b;
  if (c < 0) c += p;
  return c;
}
inline int mul(int a, int b, int p = 1000000007) { return (a * 1ll * b) % p; }
int __gcd(int a, int b) { return !b ? a : __gcd(b, a % b); }
int power(int a, int b, int p = 1000000007) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mul(res, a, p);
    a = mul(a, a, p);
    b >>= 1;
  }
  return res;
}
inline int Fermat(int a, int p = 1000000007) { return power(a, p - 2, p); }
inline int Div(int a, int b, int p) { return mul(a, Fermat(b, p), p); }
vector<int> factorize(int p) {
  vector<int> v;
  for (int i = 2; i * i <= p; i++)
    if (p % i == 0) {
      v.push_back(i);
      while (p % i == 0) p /= i;
    }
  if (p != 1) v.push_back(p);
  return v;
}
int Tot_fun(int n) {
  int phi = n;
  vector<int> v = factorize(n);
  for (int i : v) phi /= i, phi *= (i - 1);
  return phi;
}
int generator(int p, bool isPrime = true) {
  if (p == 2) return 1;
  int phi;
  phi = isPrime ? p - 1 : Tot_fun(p);
  vector<int> v = factorize(phi);
  for (int g = 2; g <= p; g++) {
    bool ok = true;
    if (!isPrime && __gcd(p, g) != 1) continue;
    for (int i = 0; i < v.size() && ok; i++)
      ok &= (power(g, phi / v[i], p) != 1);
    if (ok) {
      return g;
    }
  }
  return -1;
}
bool isPrime(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int n, g[100005];
void prep() {
  int gen = generator(n);
  g[0] = 1;
  for (int i = (1); i < (n); i++) {
    g[i] = mul(g[i - 1], gen, n);
  }
}
int32_t main() {
  clock_t clk = clock();
  cerr << "I will return...\n";
  cin >> n;
  if (n == 1)
    cout << "YES\n1\n";
  else if (n == 4)
    cout << "YES\n1\n3\n2\n4\n";
  else if (isPrime(n)) {
    cout << "YES\n";
    prep();
    for (int i = (1); i < (n + 1); i++) {
      if (i == n)
        cout << n << '\n';
      else if (i % 2)
        cout << g[n - i] << '\n';
      else
        cout << g[i - 1] << '\n';
    }
  } else
    cout << "NO\n";
  cerr << "...don't you ever hang your head.\n";
  cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << '\n';
}

### Prompt

Please create a solution in CPP to the following problem:

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;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxpq = priority_queue<T>;
inline long long CC(long long n, long long y) {
  return (((n) + (y - 1) - 1) / (y - 1)) - (((n) + (y)-1) / (y));
}
inline long long FF(long long n, long long y) { return n / y - n / (y + 1); }
inline int add(int a, int b, int p = 1000000007) {
  int c = a + b;
  if (c >= p) c -= p;
  return c;
}
inline int sub(int a, int b, int p = 1000000007) {
  int c = a - b;
  if (c < 0) c += p;
  return c;
}
inline int mul(int a, int b, int p = 1000000007) { return (a * 1ll * b) % p; }
int __gcd(int a, int b) { return !b ? a : __gcd(b, a % b); }
int power(int a, int b, int p = 1000000007) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mul(res, a, p);
    a = mul(a, a, p);
    b >>= 1;
  }
  return res;
}
inline int Fermat(int a, int p = 1000000007) { return power(a, p - 2, p); }
inline int Div(int a, int b, int p) { return mul(a, Fermat(b, p), p); }
vector<int> factorize(int p) {
  vector<int> v;
  for (int i = 2; i * i <= p; i++)
    if (p % i == 0) {
      v.push_back(i);
      while (p % i == 0) p /= i;
    }
  if (p != 1) v.push_back(p);
  return v;
}
int Tot_fun(int n) {
  int phi = n;
  vector<int> v = factorize(n);
  for (int i : v) phi /= i, phi *= (i - 1);
  return phi;
}
int generator(int p, bool isPrime = true) {
  if (p == 2) return 1;
  int phi;
  phi = isPrime ? p - 1 : Tot_fun(p);
  vector<int> v = factorize(phi);
  for (int g = 2; g <= p; g++) {
    bool ok = true;
    if (!isPrime && __gcd(p, g) != 1) continue;
    for (int i = 0; i < v.size() && ok; i++)
      ok &= (power(g, phi / v[i], p) != 1);
    if (ok) {
      return g;
    }
  }
  return -1;
}
bool isPrime(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int n, g[100005];
void prep() {
  int gen = generator(n);
  g[0] = 1;
  for (int i = (1); i < (n); i++) {
    g[i] = mul(g[i - 1], gen, n);
  }
}
int32_t main() {
  clock_t clk = clock();
  cerr << "I will return...\n";
  cin >> n;
  if (n == 1)
    cout << "YES\n1\n";
  else if (n == 4)
    cout << "YES\n1\n3\n2\n4\n";
  else if (isPrime(n)) {
    cout << "YES\n";
    prep();
    for (int i = (1); i < (n + 1); i++) {
      if (i == n)
        cout << n << '\n';
      else if (i % 2)
        cout << g[n - i] << '\n';
      else
        cout << g[i - 1] << '\n';
    }
  } else
    cout << "NO\n";
  cerr << "...don't you ever hang your head.\n";
  cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << '\n';
}

```