N=int(input()) A=list(map(int,input().split())) if A[0]>A[-1]: print("No") else: ANS=list(range(1,A[0]))+list(range(N,A[-1],-1))+list(range(A[0]+1,A[-1]))+[A[0]] print("Yes") print(*ANS)