#include #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { ll N; cin >> N; vector A(N); rep(i, N) { cin >> A[i]; if (i + 1 < A[i]) { cout << "No" << endl; return 0; } } vector revSum(N + 1, 0); for (int i = N - 1; i >= 0; --i) { revSum[i] = revSum[i + 1] + A[i]; } for (int i = 0; i < N; i++) { if (revSum[i] % (i + 1) != 0) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }