#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAXN = 100005;
int gear[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> gear[i];
  bool flag = true;
  int turns = n - gear[0];
  for (int i = 0; i < n; i++)
    if (i % 2 == 0) {
      if ((gear[i] + turns) % n != i) {
        flag = false;
        break;
      }
    } else {
      int a = gear[i] - turns;
      if (a < 0) a = n + a;
      if (a != i) {
        flag = false;
        break;
      }
    }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
