#include #include using namespace std; using ll = long long; int main(){ ll n; cin >> n; vector a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } ll cnt = 0; bool ok = true; for(int i = n - 1; i >= 0; i--){ if(a[i] > i + 1){ cout << "No" << endl; return 0; } if((cnt + a[i]) == 0) continue; if((cnt + a[i]) % (i + 1) == 0){ cnt += (a[i] + cnt) / (i + 1); } else{ ok = false; break; } } if(ok) cout << "Yes" << endl; else cout << "No" << endl; }