#include using namespace std; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } int main() { int n; cin >> n; auto a = vec(uns, n - 1); for (auto &e : a) cin >> e; sort(begin(a), end(a)); auto iter = begin(a); auto ans = vec(uns, 0); for (int i = 1; i <= n - 1; ++i) { auto m = *iter++; if (i < m) { cout << "NO" << endl; return 0; } ans.push_back(i - m + 1); } cout << "YES" << endl; for (auto e : ans) { cout << e << endl; } }