#include <bits/stdc++.h>
using namespace std;
bool prime(int n) {
  bool ret = 1;
  for (int i = 2; i <= n / i; i++) {
    if (n % i == 0) {
      ret = 0;
    }
  }
  return ret;
}
vector<int> divisor(int n) {
  vector<int> ret;
  for (int i = 2; i <= n / i; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      ret.push_back(n / i);
    }
  }
  return ret;
}
int fast_power(long long a, long long b, long long c) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (res * a) % c;
    }
    a = (a * a) % c;
    b >>= 1;
  }
  return res;
}
int primitive_root(int n) {
  vector<int> div = divisor(n - 1);
  int ret = -1;
  bool found = 0;
  for (int i = 2; i < n && ret == -1; i++) {
    found = 1;
    for (int j = 0; j < (int)div.size(); j++) {
      found &= (fast_power(i, div[j], n) != 1);
    }
    if (found) {
      ret = i;
    }
  }
  return ret;
}
void brute_force(int n) {
  vector<int> per(n);
  vector<int> cnt(n);
  int prev;
  bool found;
  for (int i = 0; i < n; i++) {
    per[i] = i + 1;
    cnt[i] = 0;
  }
  do {
    fill(cnt.begin(), cnt.end(), 0);
    found = 1;
    prev = 1;
    for (int i = 0; i < n; i++) {
      prev = (prev * per[i]) % n;
      cnt[prev]++;
    }
    for (int i = 0; i < n; i++) {
      found &= (cnt[i] == 1);
    }
    if (found) {
      break;
    }
  } while (next_permutation(per.begin(), per.end()));
  for (int i = 0; i < n; i++) {
    printf("%d\n", per[i]);
  }
}
void solve(int n) {
  if (n <= 5) {
    brute_force(n);
  } else {
    int pr = primitive_root(n);
    int a = n - 1, b = 1;
    for (int i = 0; i < n / 2; i++) {
      printf("%d\n", fast_power(pr, a, n));
      printf("%d\n", fast_power(pr, b, n));
      a = (a - 2);
      b = (b + 2);
    }
    printf("%d\n", n);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  if (n <= 5 || prime(n)) {
    printf("YES\n");
    solve(n);
  } else {
    printf("NO\n");
  }
  return 0;
}
