#include <bits/stdc++.h>
using namespace std;
int mod;
bool isp(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
bool perfect(int n) { return n == 4; }
long long fpow(long long b, long long p) {
  long long ans = 1;
  while (p) {
    if (p & 1LL) ans *= b, ans %= mod;
    b = (b * b) % mod;
    p /= 2;
  }
  return ans;
}
long long modInv(long long d) { return fpow(d, mod - 2); }
vector<long long> ans;
int main() {
  int n;
  scanf("%d", &n);
  if (isp(n)) {
    puts("YES");
    mod = n;
    long long sm = 1;
    for (int i = 1; i < n; i++) {
      sm *= i;
      sm %= mod;
    }
    ans.push_back(n);
    for (int i = 1; i < n - 1; i++) {
      long long rem = (n + 1) - sm;
      sm *= modInv(rem);
      sm %= n;
      ans.push_back(rem);
    }
    ans.push_back(1);
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  } else if (perfect(n)) {
    puts("YES");
    for (int i = 1; i <= n; i += 2) printf("%d ", i);
    for (int i = 2; i <= n; i += 2) printf("%d ", i);
  } else {
    puts("NO");
  }
}
