import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int H[] = new int[N]; H new int[N] N String s = "Yes"; s "Yes" for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			H[i] = sc.nextInt();
		} {
			H[i] = sc.nextInt();
		} H[i] = sc.nextInt() H[i] H i sc.nextInt() sc.nextInt sc sc.close() sc.close sc for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		} int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		} {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		} if (H[i] < H[i + 1]) {
				H[i + 1]--;
			} H[i] < H[i + 1] H[i] H i H[i + 1] H i + 1 i 1 {
				H[i + 1]--;
			} H[i + 1]-- H[i + 1] H i + 1 i 1 int h[] = new int[N]; h new int[N] N for (int i = 0; i < N; i++) {
			h[i] = H[i];
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			h[i] = H[i];
		} {
			h[i] = H[i];
		} h[i] = H[i] h[i] h i H[i] H i Arrays.sort(H) Arrays.sort Arrays H for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if (h[i] != H[i]) {
				s = "No";
			}
		} {
			if (h[i] != H[i]) {
				s = "No";
			}
		} if (h[i] != H[i]) {
				s = "No";
			} h[i] != H[i] h[i] h i H[i] H i {
				s = "No";
			} s = "No" s "No" System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		String s = "Yes";

		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();

		for (int i = 0; i < N - 1; i++) {
			if (H[i] < H[i + 1]) {
				H[i + 1]--;
			}
		}
		int h[] = new int[N];
		for (int i = 0; i < N; i++) {
			h[i] = H[i];
		}
		Arrays.sort(H);

		for (int i = 0; i < N; i++) {
			if (h[i] != H[i]) {
				s = "No";
			}
		}
		System.out.println(s);
	}

}
