import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	}
} Main @SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner long[] h = new long[n]; h new long[n] n for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			h[i] = scanner.nextLong();
		} {
			h[i] = scanner.nextLong();
		} h[i] = scanner.nextLong() h[i] h i scanner.nextLong() scanner.nextLong scanner String result = "Yes"; result "Yes" for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		} int i = n - 1; int i = n - 1; i n - 1 n 1 i > 0 i 0 i -- i -- i {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		} {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		} if (h[i - 1] <= h[i]) {
				continue;
			} h[i - 1] <= h[i] h[i - 1] h i - 1 i 1 h[i] h i {
				continue;
			} continue; h[i - 1] = h[i - 1] - 1 h[i - 1] h i - 1 i 1 h[i - 1] - 1 h[i - 1] h i - 1 i 1 1 if (h[i - 1] <= h[i]) {
				continue;
			} h[i - 1] <= h[i] h[i - 1] h i - 1 i 1 h[i] h i {
				continue;
			} continue; result = "No" result "No" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	}
} Main
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] h = new long[n];
		for (int i = 0; i < n; i++) {
			h[i] = scanner.nextLong();
		}
		String result = "Yes";
		for (int i = n - 1; i > 0; i --) {
			if (h[i - 1] <= h[i]) {
				continue;
			}
			h[i - 1] = h[i - 1] - 1;
			if (h[i - 1] <= h[i]) {
				continue;
			}
			result = "No";
		}
		System.out.println(result);
	}
}
