#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int a;
  int pushes_required = 0;
  int current_pushes_required = 0;
  bool success = true;
  for (int i = 0; i < n; i++) {
    scanf(" %d", &a);
    if (i % 2 == 0) {
      current_pushes_required = (i - a) % n;
    } else {
      current_pushes_required = (a - i) % n;
    }
    if (current_pushes_required < 0) current_pushes_required += n;
    if (i == 0)
      pushes_required = current_pushes_required;
    else if (pushes_required != current_pushes_required) {
      success = false;
      break;
    }
  }
  if (success)
    printf("YES");
  else
    printf("NO");
  return 0;
}
