#include // #include using namespace std; // using namespace atcoder; using ll = long long; using ull = unsigned long long; using P = pair; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define MOD 1000000007 int main(){ int n; cin >> n; vector

a(n-1); rep(i,n-1)cin >> a[i].first,a[i].second = i; sort(ALL(a)); vector res(n-1); rep(i,n-1){ if(a[i].first < i+2)res[a[i].second] = i+2-a[i].first; else{ cout << "NO\n"; return 0; } } cout << "YES\n"; rep(i,n-1)cout << res[i] << "\n"; return 0; }