import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int[] H = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean flg = true;
		for(int i=N-1;i>=1;i--) {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		}
		if(flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int[] H = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean flg = true;
		for(int i=N-1;i>=1;i--) {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		}
		if(flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} 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 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 flg = true; flg true for(int i=N-1;i>=1;i--) {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		} int i=N-1; int i=N-1; i N-1 N 1 i>=1 i 1 i-- i-- i {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		} {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		} if(flg==false) {
				break;
			} flg==false flg false {
				break;
			} break; for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			} int j=i-1; int j=i-1; j i-1 i 1 j>=0 j 0 j-- j-- j {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			} {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			} if(H[i]+2<=H[j]) {
					flg = false;
				} H[i]+2<=H[j] H[i]+2 H[i] H i 2 H[j] H j {
					flg = false;
				} flg = false flg false if(flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} flg {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

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

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int[] H = new int[N];
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
		}
		boolean flg = true;
		for(int i=N-1;i>=1;i--) {
			if(flg==false) {
				break;
			}
			for(int j=i-1;j>=0;j--) {
				if(H[i]+2<=H[j]) {
					flg = false;
				}
			}
		}
		if(flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

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