#include using namespace std; typedef long long ll; int main() { int N; cin >> N; ll A[N]; for (int i = 0; i < N; i++) { cin >> A[i]; } ll b[N]{}; if (A[N - 1] != 0 && A[N - 1] != N) { cout << "No\n"; return 0; } if (A[N - 1] == N) { b[N - 1] = 1; } for (int i = N - 2; i >= 1; i--) { if ((A[i] + b[i + 1]) % (i + 1) != 0) { cout << "No\n"; return 0; } b[i] += (A[i] + b[i + 1]) / (i + 1); } cout << "Yes\n"; return 0; }