#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int h = n;
  while (h--) {
    bool b = true;
    for (int i = 0; i < n; i++) {
      if (i != a[i]) {
        b = false;
      }
    }
    if (b) {
      cout << "YES";
      return 0;
    }
    for (int i = 0; i < n; i++) {
      if (!(i & 1)) {
        if (a[i] == (n - 1))
          a[i] = 0;
        else
          a[i]++;
      } else if (i & 1) {
        if (a[i] == 0)
          a[i] = n - 1;
        else
          a[i]--;
      }
    }
  }
  cout << "NO";
  return 0;
}
