/* -*- coding: utf-8 -*- * * 2451.cc: No.2451 Redistribute Integers - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 500000; /* typedef */ typedef long long ll; /* global variables */ int as[MAX_N]; /* subroutines */ inline int amod(int a, int n) { a %= n; if (a < 0) a += n; return a; } /* main */ int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", as + i); int d0 = amod(as[0], n); for (int i = 1; i < n; i++) if (d0 != amod(as[i], n)) { puts("No"); return 0; } puts("Yes"); return 0; }