#include #include using namespace std; void solve() { int N; cin >> N; vector A(N); for (int i = 0; i < N; ++i) cin >> A[i]; int cnt = 0; while (A[N-1-cnt] == 0) ++cnt; vector B(N-cnt); for (int i = 0; i < N-cnt; ++i) B[i] = A[i]; N -= cnt; int pls = 0; for (int i = 0; i < N; ++i){ if (i > 0 && B[N-i] <= B[N-1-i]) pls++; B[N-1-i] += pls; if ((B[N-1-i] + i) % (N-i) != 0){ cout << "No" << endl; return; } } cout << "Yes" << endl; } int main() { cin.tie(); ios::sync_with_stdio(false); // int ti = clock(); // input(); solve(); // printf("Execution Time: %.4lf sec\n", 1.0 * (clock() - ti) / CLOCKS_PER_SEC); return 0; }