#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=500;
const int MAXGN=1+3*MAXN+3*(MAXN+1)+1;
const int MAXGM=MAXN+2*MAXN+2*MAXN+2*MAXN+2*(MAXN+1)+(MAXN+1);

typedef struct G {
	int n,m,head[MAXGN],nxt[2*MAXGM],to[2*MAXGM],cap[2*MAXGM];
	void init() { REP(i,n) head[i]=-1; m=0; }

	void addedge(int a,int b,int c) {
		//printf("addedge(%d,%d,%d)\n",a,b,c);
		nxt[m]=head[a]; head[a]=m; to[m]=b; cap[m]=c; ++m;
		nxt[m]=head[b]; head[b]=m; to[m]=a; cap[m]=0; ++m;
	}
	int flow[MAXGN],back[MAXGN]; bool done[MAXGN];
	int q[MAXGN],qhead,qtail;
	int mf(int s,int t) {
		int ret=0,iter=0;
		while(true) {
			++iter;
			REP(i,n) flow[i]=0,back[i]=-1,done[i]=false; qhead=qtail=0; flow[s]=INT_MAX; back[s]=-2; q[qhead++]=s; done[s]=true;
			while(qtail<qhead) {
				int idx=q[qtail++]; for(int x=head[idx];x!=-1;x=nxt[x]) {
					if(done[to[x]]||flow[idx]<=flow[to[x]]||cap[x]<=flow[to[x]]) continue;
					flow[to[x]]=min(flow[idx],cap[x]); back[to[x]]=x^1; done[to[x]]=true; q[qhead++]=to[x];
				}
			}
			if(flow[t]==0) break;
			ret+=flow[t];
			for(int x=t;x!=s;x=to[back[x]]) {
				cap[back[x]]+=flow[t];
				cap[back[x]^1]-=flow[t];
			}
		}
		//printf("iter=%d\n",iter);
		return ret;
	}
} G;
G g;

typedef struct R {
	int val,pos;
} R;
bool operator<(const R &a,const R &b) { return a.pos<b.pos; }

int n;
R r[MAXN];
int lefta[MAXN],leftb[MAXN],curat[MAXN+1];

int s,lid[MAXN],lida[MAXN],lidb[MAXN],rida[MAXN+1],ridb[MAXN+1],rid[MAXN+1],t;

int ret[MAXN*MAXN];
int inv[MAXGN];

void run() {
	scanf("%d",&n); REP(i,n) r[i].val=i+1,scanf("%d",&r[i].pos),--r[i].pos; sort(r,r+n);
	//n=500; REP(i,n) r[i].val=i+1,r[i].pos=i*n+i;

	g.n=0; s=g.n++; REP(i,n) lid[i]=g.n++; REP(i,n) lida[i]=g.n++; REP(i,n) lidb[i]=g.n++; REPE(i,n) rid[i]=g.n++; REPE(i,n) rida[i]=g.n++; REPE(i,n) ridb[i]=g.n++; t=g.n++; g.init();
	REP(i,n) g.addedge(s,lid[i],n-1);
	REPE(i,n) { int cnt=(i==n?n*n:r[i].pos)-(i==0?-1:r[i-1].pos)-1; g.addedge(rid[i],t,cnt); }
	REP(i,n) g.addedge(lid[i],lida[i],r[i].val-1),lefta[i]=r[i].val-1;
	REP(i,n) g.addedge(lid[i],lidb[i],n-r[i].val),leftb[i]=n-r[i].val;
	REP(i,n) g.addedge(rida[i+1],rida[i],n*n);
	REP(i,n) g.addedge(ridb[i],ridb[i+1],n*n);
	REP(i,n) g.addedge(lida[i],rida[i],n*n);
	REP(i,n) g.addedge(lidb[i],ridb[i+1],n*n);
	REPE(i,n) g.addedge(rida[i],rid[i],n*n);
	REPE(i,n) g.addedge(ridb[i],rid[i],n*n);

	//printf("gn=%d gm=%d\n",g.n,g.m);
	//printf("gn=%d gm=%d\n",MAXGN,2*MAXGM);
	int flow=g.mf(s,t);
	if(flow!=n*(n-1)) { printf("No\n"); return; }
	printf("Yes\n");
	
	memset(ret,-1,sizeof(ret));
	REP(i,n) ret[r[i].pos]=r[i].val;
/*	memset(inv,-1,sizeof(inv));
	REP(i,n) inv[lida[i]]=i; REP(i,n) inv[lidb[i]]=i;
	REPE(i,n) {
		int at=i==0?0:r[i-1].pos+1;
		for(int x=g.head[rid[i]];x!=-1;x=g.nxt[x]) {
			int j=inv[g.to[x]]; if(j==-1) continue;
			int cnt=g.cap[x];
			//printf("%d -> %d=%d (%d)\n",rid[i],g.to[x],j,g.cap[x]);
			REP(k,cnt) ret[at++]=r[j].val;
		}
	} */

	REPE(i,n) curat[i]=i==0?0:r[i-1].pos+1;
	REPE(i,n) {
		int geq=0; for(int x=g.head[rida[i]];x!=-1;x=g.nxt[x]) if(g.to[x]==rid[i]) geq+=g.cap[x^1];
		//printf("%d: >= %d\n",i,geq);
		FOR(j,i,n) {
			int cur=min(geq,lefta[j]);
			lefta[j]-=cur; geq-=cur; REP(k,cur) ret[curat[i]++]=r[j].val;
		}
		if(geq!=0) printf("!!! %d\n",geq);
	}
	for(int i=n;i>=0;--i) {
		int leq=0; for(int x=g.head[ridb[i]];x!=-1;x=g.nxt[x]) if(g.to[x]==rid[i]) leq+=g.cap[x^1];
		//printf("%d:  <= %d\n",i,leq);
		for(int j=i-1;j>=0;--j) {
			int cur=min(leq,leftb[j]);
			leftb[j]-=cur; leq-=cur; REP(k,cur) ret[curat[i]++]=r[j].val;
		}
		if(leq!=0) printf("!!! %d\n",leq);
	}
	REP(i,n*n) { if(i!=0) printf(" "); printf("%d",ret[i]); } puts("");
}

int main() {
	run();
	return 0;
}


Measured memory_bytes: 2304