func_code_string: #include <bits/stdc++.h>   using namespace std;   int nxt() {     int res;     scanf( %d , &res);     return res;   }   bool is_perm(int *p, int n) {     char used[n];     memset(used, 0, sizeof(used));     for (int i = 0; i < n; ++i) {       used[p[i]] = 1;     }     for (int i = 0; i < n; ++i) {       if (!used[i]) {         return false;       }     }     return true;   }   void solve(int n) {     int a[n];     for (int i = 0; i < n; ++i) {       a[i] = i + 1;     }     do {       int p[n];       p[0] = a[0] % n;       for (int i = 1; i < n; ++i) {         p[i] = p[i - 1] * a[i] % n;       }       if (is_perm(p, n)) {         for (int i = 0; i < n; ++i) {           cout << a[i] <<    ;         }         cout << endl;       }     } while (next_permutation(a, a + n - 1));   }   void solveTest(int n) {     cout <<  YES n ;     if (n == 1) {       cout <<  1 n ;       return;     }     if (n == 2) {       cout <<  1 n2 n ;       return;     }     if (n == 3) {       cout <<  1 n2 n3 n ;       return;     }     if (n == 4) {       cout <<  1 n3 n2 n4 n ;       return;     }   }   bool isprime(int n) {     for (int i = 2; i * i <= n; ++i) {       if (n % i == 0) {         return false;       }     }     return true;   }   long long powMod(long long a, int n, long long mod) {     long long ret = 1;     while (n) {       if (n & 1) ret = ret * a % mod;       n >>= 1;       a = a * a % mod;     }     return ret;   }   void solve() {     int n = nxt();     if (n <= 4) {       solveTest(n);       return;     }     if (!isprime(n)) {       cout <<  NO n ;       return;     }     int ans[n];     ans[0] = 1;     ans[n - 1] = n;     long long pw = 1;     for (int i = 1; i + 1 < n; ++i) {       ans[i] = (i + 1) * powMod(pw, n - 2, n) % n;       pw = pw * ans[i] % n;     }     cout <<  YES n ;     for (int i = 0; i < n; ++i) {       cout << ans[i] <<   n ;     }   }   int main() {     solve();     return 0;   }   