func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = 1e9 + 7;   const long long HASH = 1e16 + 7;   const long long INF = 1e9;   long long tavan(long long a, long long b) {     return b ? (tavan(a * a, b >> 1) * (b & 1 ? a : 1)) : 1;   }   long long gcd(long long a, long long b) {     return (a < b) ? gcd(b, a) : ((a % b == 0) ? b : gcd(b, a % b));   }   bool isprime(long long x) {     for (long long i = 2; i <= sqrt(x); i++)       if (!(x % i)) return false;     return true;   }   ifstream fin( input.txt );   ofstream fout( output.txt );   long long n, a[1100];   int main() {     ios_base::sync_with_stdio(0);     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     for (int t = 0; t < n + 1000; t++) {       bool ex = 1;       for (int i = 0; i < n; i++) {         if (i % 2 == 0)           a[i]++;         else           a[i]--;         if (a[i] == n) a[i] = 0;         if (a[i] == -1) a[i] = n - 1;         if (a[i] != i) ex = 0;       }       if (ex) {         cout <<  YES ;         return 0;       }     }     cout <<  NO ;     return 0;   }   