func_code_string: #include <bits/stdc++.h>   using namespace std;   inline bool is_prime(int n) {     for (int i = 2; i * i <= n; ++i)       if (n % i == 0) return 0;     return 1;   }   inline int Exp(int a, int p, int mod) {     int res = 1;     while (p) {       if (p & 1) res = (long long)res * a % mod;       p >>= 1;       a = (long long)a * a % mod;     }     return res;   }   inline int get_root(int n) {     for (int i = 2; i < n; ++i) {       if (Exp(i, n - 1, n) != 1) continue;       bool ok = 1;       for (int j = 1; j < n - 1; ++j)         if (Exp(i, j, n) == 1) {           ok = 0;           break;         }       if (ok) return i;     }     return -1;   }   int main() {     int n;     scanf( %d , &n);     if (n == 1) {       puts( YES );       puts( 1 );       return 0;     }     if (n == 4) {       puts( YES );       puts( 1 );       puts( 3 );       puts( 2 );       puts( 4 );       return 0;     }     if (n == 2) {       puts( YES );       puts( 1 2 );       return 0;     }     if (is_prime(n)) {       puts( YES );       int g = get_root(n);       printf( %d n , Exp(g, n - 1, n));       for (int i = 1; i <= n - 2; ++i) {         if (i & 1)           printf( %d n , Exp(g, i, n));         else           printf( %d n , Exp(g, n - 1 - i, n));       }       printf( %d n , n);     } else       puts( NO );     return 0;   }   