import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;

	void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	}

	public static void main(String[] args) {
		new Main().doIt();
	}
} import java.util.*; util.* java public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;

	void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	}

	public static void main(String[] args) {
		new Main().doIt();
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int MOD = 1000000007; MOD 1000000007 final int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE final long LMAX = Long.MAX_VALUE; LMAX Long.MAX_VALUE Long Long.MAX_VALUE void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	} doIt {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		} {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		} int val = sc.nextInt(); val sc.nextInt() sc.nextInt sc if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			} max - 1 <= val max - 1 max 1 val {
				max = Math.max(val, max);
			} max = Math.max(val, max) max Math.max(val, max) Math.max Math val max {
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" public static void main(String[] args) {
		new Main().doIt();
	} main {
		new Main().doIt();
	} new Main().doIt() new Main().doIt new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;

	void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	}

	public static void main(String[] args) {
		new Main().doIt();
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;

	void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	}

	public static void main(String[] args) {
		new Main().doIt();
	}
} Main
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 1000000007;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;

	void doIt() {
		int n = sc.nextInt();
		int max = sc.nextInt();
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			//System.out.println(max + " " + val);
			if(max - 1 <= val) {
				max = Math.max(val, max);
			}
			else {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");


	}

	public static void main(String[] args) {
		new Main().doIt();
	}
}
