import java.math.*; import java.util.*; import java.io.*; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] a = new int[N]; for (int i = 0; i < N; ++i) { a[i] = sc.nextInt(); } if (a[0] > a[N - 1]) { System.out.println("No"); return; } System.out.println("Yes"); PrintWriter pw = new PrintWriter(System.out); int[] ans = new int[N]; int p = 0; for (int i = 1; i < a[N - 1]; ++i) { if (i != a[0]) { ans[p++] = i; } } for (int i = N; i >= a[N - 1]; --i) { ans[p++] = i; } for (int i = 0; i < p; ++i) { pw.print(ans[i] + (i == p - 1 ? "\n" : " ")); } pw.close(); } }