N=int(input())
A=list(map(int, input().split()))
# rank=[2,4,1,...]: A[2]=r:
continue
if (r!=N and A[i]>=A[-1]) or i==N-1:
print("No")
exit()
for j in range(i+1,r):
if M=r:
res.append(j_max+1)
j_max=j
for j in range(i,r):
if j!=j_max:
res.append(j+1)
A=A[:i]
A.append(M)
r=len(A)-1
print("Yes")
print(*res)