#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w, e, r, t;
  scanf("%d%d", &q, &t);
  for (w = 1; w < q; w++) {
    scanf("%d", &e);
    if ((w & 1) == 1)
      e = (e + t) % q;
    else
      e = (q + e - t) % q;
    if (e != w) {
      printf("No");
      return 0;
    }
  }
  printf("Yes");
  return 0;
}
