#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int p = n - a[0];
  for (int i = 1; i < n; i++) {
    if (i & 1) {
      a[i] -= p;
      a[i] += (n * 1000000);
      a[i] = a[i] % n;
      if (a[i] != i) {
        cout << "No";
        return 0;
      }
    } else {
      a[i] += p;
      a[i] %= n;
      if (a[i] != i) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}
