#include #include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); uint32_t N, i; cin >> N; vector> a(N - 1); for (i = 0; i != N - 1; ++i) cin >> a[i].first; for (i = 0; i != N - 1; ++i) a[i].second = i; vector ans(N - 1); sort(a.begin(), a.end()); for (i = 0; i != N - 1; ++i) { if (a[i].first >= i + 2) { cout << "NO\n"; return 0; } ans[a[i].second] = i + 2 - a[i].first; } cout << "YES\n"; for (i = 0; i != N - 1; ++i) cout << ans[i] << '\n'; return 0; }