#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a[1001];
  cin >> n;
  if (n == 1) {
    cout << "Yes";
    return 0;
  }
  cin >> a[1] >> a[2];
  k = (a[2] + a[1]) % n;
  if (k < 0) k += n;
  if (k != 1) {
    cout << "No";
    return 0;
  }
  for (int i = 3; i <= n; i++) {
    cin >> a[i];
    if ((a[i - 2] + 2) % n != a[i] % n) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
