#include <bits/stdc++.h>
using namespace std;
int a[1010], b[110], c[110], x, y;
string name[8] = {"vaporeon", "jolteon", "flareon", "espeon",
                  "umbreon",  "leafeon", "glaceon", "sylveon"};
string s;
int main(void) {
  int n, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  while (a[0] != 0) {
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        a[i] = (a[i] + 1) % n;
      } else {
        a[i] = (a[i] - 1) % n;
        if (a[i] == -1) {
          a[i] = a[i] + n;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != i) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
