#include <bits/stdc++.h>
using namespace std;
bool isOrdered(int a[], int n) {
  for (int i = 0; i < n; i++) {
    if (a[i] != i) return false;
  }
  return true;
}
void nextSequence(int a[], int n) {
  for (int i = 0; i < n; i++) {
    if (!(i & 1))
      a[i] = (a[i] - 1 + n) % n;
    else
      a[i] = (a[i] + 1) % n;
  }
}
int main() {
  int n, a[1010];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (isOrdered(a, n)) {
      flag = true;
      break;
    }
    nextSequence(a, n);
  }
  if (flag)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
