#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto& i : v) cin >> i;
  bool ok = true;
  int time = ((n - v[0]) % n + n) % n;
  for (int i = 1; i < n; i++) {
    int ttime;
    if (i % 2)
      ttime = ((v[i] - i) % n + n) % n;
    else
      ttime = ((i - v[i]) % n + n) % n;
    if (ttime != time) ok = false;
    ;
  }
  cout << (ok ? "Yes" : "No") << '\n';
  return 0;
}
