#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  cin >> n;
  vector<int> a, b, c;
  for (int i = 0; i < n; i++) {
    cin >> s;
    a.push_back(s);
    b.push_back(i);
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (a[i] <= b[i])
        c.push_back(abs(a[i] - b[i]));
      else {
        int d = b[i] + n;
        c.push_back(abs(a[i] - d));
      }
    } else {
      if (a[i] >= b[i])
        c.push_back(abs(a[i] - b[i]));
      else {
        int d = a[i] + n;
        c.push_back(abs(b[i] - d));
      }
    }
  }
  int f = 0, m = c[0];
  {
    for (int i = 1; i < n; i++) {
      if (c[i] != m) {
        f = 1;
        break;
      }
    }
    if (f == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
