#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, steps;
  cin >> n >> a;
  steps = n - a;
  for (long long int i = 1; i < n; i++) {
    cin >> a;
    (a += (i & 1) ? n - steps : steps) %= n;
    if (a != i) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
