#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, count = 0, now = 0;
  cin >> n;
  cin >> x;
  if (x == 0)
    count = 0;
  else
    count = n - x;
  for (int i = 1; i < n; i++) {
    cin >> x;
    if (i % 2 == 1) {
      if (x >= i) {
        if (count != x - i) {
          cout << "No" << endl;
          return 0;
        }
      } else {
        if (count != n - i + x) {
          cout << "No" << endl;
          return 0;
        }
      }
    } else {
      if (x > i) {
        if (count != n - x + i) {
          cout << "No" << endl;
          return 0;
        }
      } else {
        if (count != i - x) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
