#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n, a;
  while (~scanf("%d", &n)) {
    v.clear();
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a);
      v.push_back(a);
    }
    bool flag = false;
    int count = 0;
    while (count <= 10000) {
      int cnt = 0;
      for (int i = 0; i < n - 1; i++) {
        if (v[i] < v[i + 1]) cnt++;
      }
      if (cnt + 1 == n) {
        flag = true;
        break;
      }
      for (int i = 1; i <= n; i++) {
        if (i % 2) {
          if (v[i - 1] + 1 == n)
            v[i - 1] = 0;
          else
            v[i - 1] += 1;
        } else {
          if (v[i - 1] == 0)
            v[i - 1] = n - 1;
          else
            v[i - 1] -= 1;
        }
      }
      count++;
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
