#include <bits/stdc++.h>
using namespace std;
const int MN = 1e3 + 100;
int a[MN], n;
bool check() {
  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++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (check()) return cout << "Yes", 0;
    for (int i = 0; i < n; i++) {
      a[i] = (a[i] - 2 * (i % 2) + 1 + n) % n;
    }
  }
  cout << "No";
}
