#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int a[N];
int l[N];
int r[N];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    for (int i = 0; i < n; i++) {
      if (i == 0) {
        l[i] = n - 1;
        r[i] = i + 1;
      } else if (i == n - 1) {
        l[i] = i - 1;
        r[i] = 0;
      } else {
        l[i] = i - 1;
        r[i] = i + 1;
      }
    }
    bool yes = false;
    for (int i = 0; i < 5000; i++) {
      for (int i = 0; i < n; i++) {
        if (i % 2) {
          a[i] = r[a[i]];
        } else {
          a[i] = l[a[i]];
        }
      }
      bool isOK = true;
      for (int i = 0; i < n - 1; i++)
        if (a[i] != a[i + 1] - 1) {
          isOK = false;
          break;
        }
      if (isOK) {
        yes = true;
        puts("Yes");
        break;
      }
    }
    if (!yes) puts("No");
  }
  return 0;
}
