#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
class Mint {
 private:
  int value;
  template <typename T>
  static T inverse(T a, T m) {
    T u = 0, v = 1;
    while (a != 0) {
      T t = m / a;
      m -= t * a;
      swap(a, m);
      u -= t * v;
      swap(u, v);
    }
    assert(m == 1);
    return u;
  }

 public:
  constexpr Mint() : value(0) {}
  template <class U>
  Mint(const U& x) {
    value = normalize(x);
  }
  template <class U>
  static int normalize(const U& x) {
    int ret;
    if (-mod <= x and x < mod)
      ret = x;
    else
      ret = x % mod;
    if (ret < 0) ret += mod;
    return ret;
  }
  static void set_mod(int new_mod) { mod = new_mod; }
  const int& operator()() const { return value; }
  Mint& operator+=(const Mint& other) {
    if ((value += other.value) >= mod) value -= mod;
    return *this;
  }
  Mint& operator-=(const Mint& other) {
    if ((value -= other.value) < 0) value += mod;
    return *this;
  }
  Mint& operator++() { return *this += 1; }
  Mint& operator--() { return *this -= 1; }
  Mint operator++(int) {
    Mint ret(*this);
    *this += 1;
    return ret;
  }
  Mint operator--(int) {
    Mint ret(*this);
    *this -= 1;
    return ret;
  }
  Mint operator-() const { return Mint(-value); }
  Mint& operator*=(const Mint& other) {
    value = normalize(1LL * value * other.value);
    return *this;
  }
  Mint& operator/=(const Mint& other) {
    return *this *= Mint(inverse(other.value, mod));
  }
  friend bool operator==(const Mint& lhs, const Mint& rhs) {
    return lhs.value == rhs.value;
  }
  template <class U>
  friend bool operator==(const Mint& lhs, U rhs) {
    return lhs == Mint(rhs);
  }
  template <class U>
  friend bool operator==(U lhs, const Mint& rhs) {
    return Mint(lhs) == rhs;
  }
  friend bool operator!=(const Mint& lhs, const Mint& rhs) {
    return not(lhs == rhs);
  }
  template <class U>
  friend bool operator!=(const Mint& lhs, U rhs) {
    return not(lhs == rhs);
  }
  template <class U>
  friend bool operator!=(U lhs, const Mint& rhs) {
    return not(lhs == rhs);
  }
  friend bool operator<(const Mint& lhs, const Mint& rhs) {
    return lhs.value < rhs.value;
  }
  friend Mint operator+(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) += rhs;
  }
  template <class U>
  friend Mint operator+(const Mint& lhs, U rhs) {
    return Mint(lhs) += rhs;
  }
  template <class U>
  friend Mint operator+(U lhs, const Mint& rhs) {
    return Mint(lhs) += rhs;
  }
  friend Mint operator-(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) -= rhs;
  }
  template <class U>
  friend Mint operator-(const Mint& lhs, U rhs) {
    return Mint(lhs) -= rhs;
  }
  template <class U>
  friend Mint operator-(U lhs, const Mint& rhs) {
    return Mint(lhs) -= rhs;
  }
  friend Mint operator*(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) *= rhs;
  }
  template <class U>
  friend Mint operator*(const Mint& lhs, U rhs) {
    return Mint(lhs) *= rhs;
  }
  template <class U>
  friend Mint operator*(U lhs, const Mint& rhs) {
    return Mint(lhs) *= rhs;
  }
  friend Mint operator/(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) /= rhs;
  }
  template <class U>
  friend Mint operator/(const Mint& lhs, U rhs) {
    return Mint(lhs) /= rhs;
  }
  template <class U>
  friend Mint operator/(U lhs, const Mint& rhs) {
    return Mint(lhs) /= rhs;
  }
  friend Mint power(Mint a, long long b) {
    assert(b >= 0);
    Mint ret = 1;
    while (b != 0) {
      if (b & 1) ret *= a;
      a *= a;
      b >>= 1;
    }
    return ret;
  }
  friend std::ostream& operator<<(std::ostream& stream, const Mint& number) {
    return stream << number();
  }
  friend std::istream& operator>>(std::istream& stream, Mint& number) {
    long long x;
    stream >> x;
    number.value = Mint::normalize(x);
    return stream;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "YES\n";
    cout << 1 << '\n';
    return (0);
  }
  if (n == 4) {
    cout << "YES\n";
    cout << "1 3 2 4" << '\n';
    return (0);
  }
  bool is_prime = true;
  for (int d = 2; d * d <= n; d++)
    if (n % d == 0) is_prime = false;
  if (not is_prime) {
    cout << "NO\n";
    return (0);
  }
  cout << "YES\n1\n";
  Mint::set_mod(n);
  Mint z = 2;
  for (int i = 2; i <= n - 1; i++) {
    cout << z / (z - 1) << '\n';
    z += 1;
  }
  cout << n << '\n';
  return (0);
}

### Prompt

In Cpp, your task is to solve 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;
int mod = 1e9 + 7;
class Mint {
 private:
  int value;
  template <typename T>
  static T inverse(T a, T m) {
    T u = 0, v = 1;
    while (a != 0) {
      T t = m / a;
      m -= t * a;
      swap(a, m);
      u -= t * v;
      swap(u, v);
    }
    assert(m == 1);
    return u;
  }

 public:
  constexpr Mint() : value(0) {}
  template <class U>
  Mint(const U& x) {
    value = normalize(x);
  }
  template <class U>
  static int normalize(const U& x) {
    int ret;
    if (-mod <= x and x < mod)
      ret = x;
    else
      ret = x % mod;
    if (ret < 0) ret += mod;
    return ret;
  }
  static void set_mod(int new_mod) { mod = new_mod; }
  const int& operator()() const { return value; }
  Mint& operator+=(const Mint& other) {
    if ((value += other.value) >= mod) value -= mod;
    return *this;
  }
  Mint& operator-=(const Mint& other) {
    if ((value -= other.value) < 0) value += mod;
    return *this;
  }
  Mint& operator++() { return *this += 1; }
  Mint& operator--() { return *this -= 1; }
  Mint operator++(int) {
    Mint ret(*this);
    *this += 1;
    return ret;
  }
  Mint operator--(int) {
    Mint ret(*this);
    *this -= 1;
    return ret;
  }
  Mint operator-() const { return Mint(-value); }
  Mint& operator*=(const Mint& other) {
    value = normalize(1LL * value * other.value);
    return *this;
  }
  Mint& operator/=(const Mint& other) {
    return *this *= Mint(inverse(other.value, mod));
  }
  friend bool operator==(const Mint& lhs, const Mint& rhs) {
    return lhs.value == rhs.value;
  }
  template <class U>
  friend bool operator==(const Mint& lhs, U rhs) {
    return lhs == Mint(rhs);
  }
  template <class U>
  friend bool operator==(U lhs, const Mint& rhs) {
    return Mint(lhs) == rhs;
  }
  friend bool operator!=(const Mint& lhs, const Mint& rhs) {
    return not(lhs == rhs);
  }
  template <class U>
  friend bool operator!=(const Mint& lhs, U rhs) {
    return not(lhs == rhs);
  }
  template <class U>
  friend bool operator!=(U lhs, const Mint& rhs) {
    return not(lhs == rhs);
  }
  friend bool operator<(const Mint& lhs, const Mint& rhs) {
    return lhs.value < rhs.value;
  }
  friend Mint operator+(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) += rhs;
  }
  template <class U>
  friend Mint operator+(const Mint& lhs, U rhs) {
    return Mint(lhs) += rhs;
  }
  template <class U>
  friend Mint operator+(U lhs, const Mint& rhs) {
    return Mint(lhs) += rhs;
  }
  friend Mint operator-(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) -= rhs;
  }
  template <class U>
  friend Mint operator-(const Mint& lhs, U rhs) {
    return Mint(lhs) -= rhs;
  }
  template <class U>
  friend Mint operator-(U lhs, const Mint& rhs) {
    return Mint(lhs) -= rhs;
  }
  friend Mint operator*(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) *= rhs;
  }
  template <class U>
  friend Mint operator*(const Mint& lhs, U rhs) {
    return Mint(lhs) *= rhs;
  }
  template <class U>
  friend Mint operator*(U lhs, const Mint& rhs) {
    return Mint(lhs) *= rhs;
  }
  friend Mint operator/(const Mint& lhs, const Mint& rhs) {
    return Mint(lhs) /= rhs;
  }
  template <class U>
  friend Mint operator/(const Mint& lhs, U rhs) {
    return Mint(lhs) /= rhs;
  }
  template <class U>
  friend Mint operator/(U lhs, const Mint& rhs) {
    return Mint(lhs) /= rhs;
  }
  friend Mint power(Mint a, long long b) {
    assert(b >= 0);
    Mint ret = 1;
    while (b != 0) {
      if (b & 1) ret *= a;
      a *= a;
      b >>= 1;
    }
    return ret;
  }
  friend std::ostream& operator<<(std::ostream& stream, const Mint& number) {
    return stream << number();
  }
  friend std::istream& operator>>(std::istream& stream, Mint& number) {
    long long x;
    stream >> x;
    number.value = Mint::normalize(x);
    return stream;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "YES\n";
    cout << 1 << '\n';
    return (0);
  }
  if (n == 4) {
    cout << "YES\n";
    cout << "1 3 2 4" << '\n';
    return (0);
  }
  bool is_prime = true;
  for (int d = 2; d * d <= n; d++)
    if (n % d == 0) is_prime = false;
  if (not is_prime) {
    cout << "NO\n";
    return (0);
  }
  cout << "YES\n1\n";
  Mint::set_mod(n);
  Mint z = 2;
  for (int i = 2; i <= n - 1; i++) {
    cout << z / (z - 1) << '\n';
    z += 1;
  }
  cout << n << '\n';
  return (0);
}

```