#include <bits/stdc++.h>
using namespace std;
int l[1000];
int l2[1000];
bool can = false;
bool check(int l[], int n) {
  for (int i = 0; i < n; i++)
    if (l[i] != i) return false;
  can = true;
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> l[i];
    l2[i] = l[i];
  }
  int k = 0;
  while (k < n && !can) {
    check(l, n);
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        l[i] = (l[i] + 1) % n;
      } else {
        l[i] = (l[i] - 1 + n) % n;
      }
    }
    k++;
  }
  k = 0;
  while (k < n && !can) {
    check(l2, n);
    for (int i = 0; i < n; i++) {
      if (i % 2 == 1) {
        l2[i] = (l2[i] + 1) % n;
      } else {
        l2[i] = (l2[i] - 1 + n) % n;
      }
    }
    k++;
  }
  if (can)
    cout << "Yes";
  else
    cout << "No";
}
