#include <bits/stdc++.h>
using namespace std;
int a[1001];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < 1000; i++) {
    bool b = true;
    for (int j = 0; j < n; j++) {
      if (a[j] != j) {
        b = false;
        break;
      }
    }
    if (b == true) {
      cout << "YES" << endl;
      return 0;
    }
    for (int j = 0; j < n; j++) {
      if (j % 2 == 0) {
        a[j]++;
        a[j] %= n;
      } else {
        a[j]--;
        if (a[j] < 0) a[j] += n;
      }
    }
  }
  cout << "NO" << endl;
}
