/** * 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; vi a(n-1); rep(i,n-1) cin >> a[i]; sort(all(a)); rep(i,n-1){ if(a[i]>(i+1)){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; rep(i,n-1) cout << (i+2)-a[i] << endl; }