#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), t(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < n; ++i) {
      if (i % 2) {
        a[i]--;
        if (a[i] < 0) a[i] = n - 1;
      } else {
        a[i]++;
        if (a[i] == n) a[i] = 0;
      }
    }
    int x;
    for (x = 0; x < n; ++x) {
      if (a[x] != x) break;
    }
    if (x == n) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
