#include <bits/stdc++.h>
using namespace std;
stack<int> S;
int a[1005], n;
bool judge() {
  for (int i = 0; i < n; i++)
    if (a[i] != i) return 0;
  return 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= n; i++) {
    if (judge()) {
      cout << "Yes" << endl;
      return 0;
    }
    for (int j = 0; j < n; j += 2) a[j] = (a[j] + 1) % n;
    for (int j = 1; j < n; j += 2) a[j] = (a[j] - 1 + n) % n;
  }
  cout << "No" << endl;
  return 0;
}
