#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0, l = 0, a[1005];
  cin >> n;
  cin >> a[1];
  int k = n - a[1];
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 0) {
      if ((a[i] + n - k) % n != i - 1) {
        l = 1;
        break;
      }
    } else if ((a[i] + k) % n != i - 1) {
      l = 1;
      break;
    }
  }
  if (l == 1)
    cout << "No";
  else
    cout << "Yes";
}
