#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; vector> a(N-1); for(int i = 1; i <= N - 1; i++) { cin >> a[i-1].first; a[i-1].second = i; } sort(a.begin(), a.end()); int ok = 1; for(int i = 1; i <= N - 1; i++) ok &= (a[i-1].first <= i); if(ok) { cout << "YES" << endl; for(int i = 1; i <= N - 1; i++) a[i-1].first = (i + 1) - a[i-1].first; sort(a.begin(), a.end(), [](auto I, auto J){ return I.second < J.second; }); for(int i = 1; i <= N - 1; i++) cout << a[i - 1].first << "\n"; } else { cout << "NO" << endl; } }