#include <bits/stdc++.h>
using namespace std;
int n;
bool clockwise = true;
int main() {
  cin >> n;
  int hanygomb;
  int a;
  cin >> a;
  hanygomb = n - a;
  for (int i = 1; i < n; i++) {
    clockwise = !clockwise;
    cin >> a;
    if (clockwise)
      a = (a + hanygomb) % n;
    else
      a = (a - hanygomb + n) % n;
    if (a != i) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
