#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; vector> a; int ans[100010]; int main() { int n; cin >> n; for (int i = 0; i < n - 1; i++) { int a1; cin >> a1; a.emplace_back(make_pair(a1, i)); } sort(a.begin(), a.end()); for (int i = 0; i < n - 1; i++) { ans[a[i].second] = (i + 2) - a[i].first; if (ans[a[i].second] <= 0) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; for (int i = 0; i < n - 1; i++) { cout << ans[i] << endl; } }