#include <bits/stdc++.h>
using namespace std;
const int Maxx = 1000005, Maxn = 2005, INF = 0x3f3f3f3f, Mod = 1e9 + 7;
inline int read() {
  int res = 0;
  char bj = 0, ch = getchar();
  while (ch < '0' || ch > '9') bj |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + (ch ^ 48), ch = getchar();
  return bj ? -res : res;
}
void print(int x) {
  if (x > 9) print(x / 10);
  putchar(x % 10 ^ 48);
}
inline void printnum(int x, char ch) {
  if (x < 0) putchar('-'), x = -x;
  print(x), putchar(ch);
}
inline long long Qpow(long long x, int p, const int M) {
  static long long res;
  for (res = 1; p; p >>= 1, x = x * x % M)
    if (p & 1) res = res * x % M;
  return res;
}
inline int Get_Root(const int P) {
  static int M, pm[20], R;
  M = 0;
  int x = P - 1;
  for (int i = 2; i * i <= x; ++i)
    if (x % i == 0) {
      pm[++M] = i;
      do x /= i;
      while (x % i == 0);
    }
  if (x > 1) pm[++M] = x;
  for (R = 2; R <= P; ++R) {
    char bj = 1;
    for (int j = 1; bj && j <= M; ++j) bj &= Qpow(R, (P - 1) / pm[j], P) > 1;
    if (bj) break;
  }
  return R;
}
int md[Maxx];
int main() {
  int n = read();
  long long G = 1;
  for (int i = 2; i < n; ++i) G = G * i % n;
  if (!G)
    puts("NO");
  else if (n == 2)
    puts("YES"), puts("1 2");
  else if (n == 4)
    puts("YES"), puts("1 3 2 4");
  else {
    G = Get_Root(n);
    for (int i = md[0] = 1; i < n; ++i) md[i] = G * md[i - 1] % n;
    puts("YES");
    for (int i = 1; i < n; ++i)
      printnum(md[n - i], '\n'), printnum(md[i++], '\n');
    printnum(n, '\n');
  }
  return 0;
}
