#include <bits/stdc++.h>
using namespace std;
int n, t = 1, a[10001];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  while (a[0] > 0)
    for (int i = 0; i < n; i++) a[i] = (a[i] + 1 - (i % 2) * 2 + n) % n;
  for (int i = 0; i < n; i++) t += (a[i] != i);
  if ((n % 2 == 1 && n > 3) || t == 1)
    cout << "Yes\n";
  else
    cout << "No\n";
}
