import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	} main {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] n = new int[scan.nextInt()]; n new int[scan.nextInt()] scan.nextInt() scan.nextInt scan String str = "Yes"; str "Yes" for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n.length i n.length n n.length i++ i++ i {
			n[i] = scan.nextInt();
		} {
			n[i] = scan.nextInt();
		} n[i] = scan.nextInt() n[i] n i scan.nextInt() scan.nextInt scan for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		} int i = n.length - 1; int i = n.length - 1; i n.length - 1 n.length n n.length 1 0 < i 0 i i-- i-- i {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		} {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		} if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			} n[i - 1] > n[i] n[i - 1] n i - 1 i 1 n[i] n i {
				n[i - 1] = n[i - 1] - 1;
			} n[i - 1] = n[i - 1] - 1 n[i - 1] n i - 1 i 1 n[i - 1] - 1 n[i - 1] n i - 1 i 1 1 for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		} int i = 0; int i = 0; i 0 i < n.length - 1 i n.length - 1 n.length n n.length 1 i++ i++ i {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		} {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		} if (n[i + 1] < n[i]) {
				str = "No";
			} n[i + 1] < n[i] n[i + 1] n i + 1 i 1 n[i] n i {
				str = "No";
			} str = "No" str "No" System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] n = new int[scan.nextInt()];
		String str = "Yes";
		for (int i = 0; i < n.length; i++) {
			n[i] = scan.nextInt();
		}
		for (int i = n.length - 1; 0 < i; i--) {
			if (n[i - 1] > n[i]) {
				n[i - 1] = n[i - 1] - 1;
			}
		}
		for (int i = 0; i < n.length - 1; i++) {
			if (n[i + 1] < n[i]) {
				str = "No";
			}
		}
		System.out.println(str);
	}
}