#include #include using namespace std; using ll = long long; int main(){ int n; scanf("%d", &n); vector a(n); for(int i = 0; i < n; i++){ scanf("%d", &a[i]); } int cnt = 0; bool ok = true; for(int i = n - 1; i >= 0; i--){ 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; }