#include <bits/stdc++.h>
using namespace std;
int n, a[1002][1002];
int main() {
  while (cin >> n) {
    bool flag = 1;
    for (int i = 0; i < n; i++) {
      cin >> a[i][0];
      int t = a[i][0];
      if (flag) {
        for (int j = 1; j < n; j++) {
          if (t <= 0) t = n;
          a[i][j] = --t;
        }
        flag = 0;
      } else {
        for (int j = 1; j < n; j++) {
          if (t >= n - 1) t = -1;
          a[i][j] = ++t;
        }
        flag = 1;
      }
    }
    flag = 1;
    for (int i = 0; i < n; i++) {
      if (a[0][i] == 0) {
        for (int j = 1; j < n; j++) {
          if (a[j][i] != j) {
            flag = 0;
            break;
          }
        }
        break;
      }
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
