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