#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  long long int a[n], j = 0, yes = 1;
  for (long long int i = 0, x = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int r = n - a[0];
  for (long long int i = 0; i < n; i++) {
    if (i & 1)
      a[i] += n - r;
    else
      a[i] += r;
    a[i] %= n;
    if (a[i] != i) {
      yes = 0;
      break;
    }
  }
  if (yes)
    cout << "YES";
  else
    cout << "NO";
}
