#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bool flag;
  cin >> n;
  int *arr = new int[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    flag = true;
    for (int j = 0; j < n; j++) {
      if (arr[j] == j)
        continue;
      else {
        flag = false;
        break;
      }
    }
    if (flag) goto END;
    for (int j = 0; j < n; j++) {
      if (j % 2 == 0) {
        arr[j]++;
        if (arr[j] > n - 1) arr[j] = 0;
      } else {
        arr[j]--;
        if (arr[j] < 0) arr[j] = n - 1;
      }
    }
  }
END:
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
  delete[] arr;
  return 0;
}
