#include <bits/stdc++.h>
using namespace std;
vector<int> read_sequence(istream& s, int n) {
  vector<int> res;
  copy_n(istream_iterator<int>(s), n, back_inserter(res));
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<int> gears = read_sequence(cin, n);
  auto solve = [&]() {
    if (n == 1) return true;
    int first = gears[0];
    int second = gears[1];
    if ((first + second) % n != 1) return false;
    for (int i = 0; i < n; ++i) {
      int check_el =
          (i % 2 == 0) ? ((first + i) % n) : ((second + (i - 1)) % n);
      if (gears[i] != check_el) return false;
    }
    return true;
  };
  cout << (solve() ? "Yes" : "No") << endl;
}
