#include <bits/stdc++.h>
using namespace std;
int p;
int pm(int x, int e) {
  int res = 1;
  int tmp = x;
  while (e > 0) {
    if (e & 1) res = ((long long)res * tmp) % p;
    tmp = ((long long)tmp * tmp) % p;
    e >>= 1;
  }
  return res;
}
bool prim() {
  for (int i = 2; i * i <= p; ++i)
    if (p % i == 0) return false;
  return true;
}
vector<int> d;
void roz() {
  int M = p - 1;
  for (int i = 2; i * i < p; ++i) {
    if (M % i == 0) d.push_back(M / i);
  }
}
bool ok(int x) {
  for (int i = 0; i < d.size(); ++i)
    if (pm(x, d[i]) == 1) return false;
  return true;
}
int gen() {
  roz();
  for (int i = 2; i < p; ++i) {
    if (ok(i)) return i;
  }
}
int main() {
  scanf("%d", &p);
  if (p == 1) {
    printf("YES\n1\n");
  } else if (p == 2) {
    printf("YES\n1\n2\n");
  } else if (p == 4) {
    printf("YES\n1\n3\n2\n4\n");
  } else if (!prim()) {
    printf("NO\n");
  } else {
    int g = gen();
    printf("YES\n");
    for (int i = 0; i < (p - 1) / 2; ++i) {
      printf("%d\n%d\n", pm(g, p - 1 - 2 * i), pm(g, 1 + 2 * i));
    }
    printf("%d\n", p);
  }
  return 0;
}
