#include #include using namespace std; using ll = long long; #define REP(i,n) for(int i=0;i void chmin(T& a, T b) { a = min(a, b); } template void chmax(T& a, T b) { a = max(a, b); } #define PR(x) cerr << #x << "=" << x << endl using i128 = __int128_t; int main() { int n; cin >> n; vector a(n); REP(i, n) cin >> a[i]; bool ok = true; REP(i, n-1) { if(abs(a[i+1] - a[i]) % n != 0) ok = false; } if(ok) cout << "Yes"; else cout << "No"; return 0; }