/* -*- coding: utf-8 -*- * * 1219.cc: No.1219 Mancala Combo - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ typedef long long ll; /* global variables */ int as[MAX_N + 1]; /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", as + i); ll sum = 0; for (int i = n; i >= 1; i--) { if ((sum + as[i]) % i != 0) { puts("No"); return 0; } sum += (sum + as[i]) / i; } puts("Yes"); return 0; }