#include <bits/stdc++.h>
using namespace std;
int Abs(int a) { return a >= 0 ? a : a * -1; }
int main() {
  int n, inicial, i, tmp;
  vector<int> nums;
  cin >> n;
  nums.resize(n);
  cin >> nums[0];
  inicial = (n - nums[0]) % n;
  for (i = 1; i < n; ++i) {
    cin >> nums[i];
    if (i & 1) {
      if (nums[i] > i)
        tmp = Abs(nums[i] - i);
      else
        tmp = (n + nums[i] - i) % n;
    } else {
      if (nums[i] > i)
        tmp = (n - nums[i] + i) % n;
      else
        tmp = Abs(nums[i] - i);
    }
    if (inicial != tmp) break;
  }
  if (i == n)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
