#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
int pos[mx], n;
int main() {
  cin >> n;
  for (int i = int(1); i <= int(n); ++i) cin >> pos[i];
  int nr = (0 - pos[1] + n) % n;
  int chk = 1;
  for (int i = int(2); i <= int(n); ++i) {
    if ((i & 1) == 0) {
      if ((pos[i] - nr + n) % n != i - 1) {
        chk = 0;
        break;
      }
    } else {
      if ((pos[i] + nr) % n != i - 1) {
        chk = 0;
        break;
      }
    }
  }
  if (chk)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
