#include using namespace std; int main() { int64_t n; cin >> n; vector as(n + 1, 0); for (int64_t i = 1; i <= n; i++) { cin >> as[i]; } int64_t sum = accumulate(as.begin(), as.end(), int64_t(0)); while (as[0] != sum) { bool f = true; for (int64_t i = 1; i <= n; i++) { if (as[i] == i) { f = false; as[i] = 0; for (int64_t j = i - 1; 0 <= j; j--) { as[j]++; } break; } } if (f) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }