#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int ans;
  if (v[0] == 0) {
    ans = 0;
  } else {
    ans = n - v[0];
  }
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] == i && ans != 0) {
      f = 1;
      break;
    }
    if (i % 2 == 0) {
      if (v[i] < i && i - v[i] != ans) {
        f = 1;
        break;
      } else if (v[i] > i && n - (v[i] - i) != ans) {
        f = 1;
        break;
      }
    } else {
      if (v[i] > i && v[i] - i != ans) {
        f = 1;
        break;
      } else if (v[i] < i && n - (i - v[i]) != ans) {
        f = 1;
        break;
      }
    }
  }
  if (f == 1) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
