#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
int n; cin>>n;
vector<int> a(n+1);
for (int i=1; i<n; ++i) cin>>a[i];
stack<int> s;
vector<int> p(n+1);
iota(all(p),0);
for (int i=1; i<=n; ++i)
{
if (a[i]-a[i-1]==-2)
{
if (s.empty())
{
cout<<"No\n";
return 0;
}
int x=s.top(); s.pop();
swap(p[x],p[i]);
continue;
}
if (a[i]-a[i-1]==0)
{
continue;
}
if (a[i]-a[i-1]==2)
{
s.push(i);
continue;
}
cout<<"No\n";
return 0;
}
cout<<"Yes\n";
for (int i=1; i<=n; ++i) cout<<p[i]<<" \n"[i==n];
}
dfadsfasdf