#include #define rep(i,N) for(int i=0;i<(N);i++) #define rrep(i, n) for (int i = (int)n-1; i >= 0; --i) #define FOR(i,a,b) for(int i=(a);i<(b);i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; const int mod = 1e9+7; typedef long long ll; typedef pair P; typedef set S; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } __attribute__ ((constructor)) void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(10); } int main(){ int n; cin >> n; vector visited(n, 0); vector> a(n - 1); rep(i, n - 1){ int a_now; cin >> a_now; a[i] = make_pair(a_now, i); } sort(a.begin(), a.end()); visited[0] = true; vector> ans; FOR(i,1,n){ int now_index = i ; int now_index_to = i- a[i - 1].first; if(now_index_to < 0){ cout << "NO" << endl; return 0; } if(visited[now_index_to]){ visited[now_index] = true; ans.push_back({a[i - 1].second,now_index_to + 1}); } } cout << "YES" << endl; sort(ans.begin(), ans.end()); rep(i, int(ans.size())){ cout << ans[i].second << endl; } return 0; }