#include <bits/stdc++.h>
using namespace std;
const int PRIME = 1000 * 1000 * 1000 + 7;
const int MULTIPLIER = 523;
const int INFI = (1 << 30) - 1;
const long double INF = 2 * 1e9 + 1;
const long double EPS = 1e-9;
const long double PI = 3.141592653589793238462643383279502884L;
const int DIM = 2;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int *a = new int[n];
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  for (int j = 1; j <= n; ++j) {
    bool ok = true;
    for (int k = 0; k < n; ++k) {
      if (k % 2 == 0) {
        ++a[k];
        if (a[k] == n) {
          a[k] = 0;
        }
      } else {
        --a[k];
        if (a[k] == -1) {
          a[k] = n - 1;
        }
      }
      if (a[k] != k) {
        ok = false;
      }
    }
    if (ok) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
