/** * author: shu8Cream * created: 05.02.2021 22:21:24 **/ #include using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using P = pair; using vi = vector; using vvi = vector; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector

a(n-1); rep(i,n-1){ cin >> a[i].first; a[i].second=i; } sort(all(a)); rep(i,n-1){ if(a[i].first>(i+1)){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; vi ans(n-1); rep(i,n-1) ans[a[i].second]=(i+2)-a[i].first; rep(i,n-1) cout << ans[i] << endl; }