import java.util.Scanner;

class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int H[] = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean f = true;
		for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		}
		System.out.println(f ? "Yes" : "No");

	}
} import java.util.Scanner; Scanner java.util class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int H[] = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean f = true;
		for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		}
		System.out.println(f ? "Yes" : "No");

	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int N = sc.nextInt();
		int H[] = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean f = true;
		for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		}
		System.out.println(f ? "Yes" : "No");

	} main {
		int N = sc.nextInt();
		int H[] = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean f = true;
		for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		}
		System.out.println(f ? "Yes" : "No");

	} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int H[] = new int[N]; H new int[N] N 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 boolean f = true; f true for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		} {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		} if (H[i] > H[i - 1]) {
				H[i]--;
			} H[i] > H[i - 1] H[i] H i H[i - 1] H i - 1 i 1 {
				H[i]--;
			} H[i]-- H[i] H i if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			} H[i] < H[i - 1] H[i] H i H[i - 1] H i - 1 i 1 {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			} if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--; H[i] - 1 < H[i - 1] H[i] - 1 H[i] H i 1 H[i - 1] H i - 1 i 1 {
					f = false;
					break;
				} f = false f false break; H[i]-- H[i] H i System.out.println(f ? "Yes" : "No") System.out.println System.out System System.out f ? "Yes" : "No" f "Yes" "No" String[] args args
import java.util.Scanner;

class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int H[] = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean f = true;
		for (int i = 1; i < N; i++) {
			if (H[i] > H[i - 1]) {
				H[i]--;
			}
			if (H[i] < H[i - 1]) {
				if (H[i] - 1 < H[i - 1]) {
					f = false;
					break;
				} else
					H[i]--;
			}
		}
		System.out.println(f ? "Yes" : "No");

	}
}