import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			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 H[0] = sc.nextInt() H[0] H 0 sc.nextInt() sc.nextInt sc boolean jud = true; jud true for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		} int i=1; int i=1; i 1 i<N i N i++ i++ i {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		} {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		} H[i] = sc.nextInt() H[i] H i sc.nextInt() sc.nextInt sc if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			} H[i] > H[i-1] H[i] H i H[i-1] H i-1 i 1 {
				H[i] -= 1;
			} H[i] -= 1 H[i] H i 1 if(H[i]<H[i-1]) {
				jud = false;
				break;
			} H[i]<H[i-1] H[i] H i H[i-1] H i-1 i 1 {
				jud = false;
				break;
			} jud = false jud false break; if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		} jud {
			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) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
} public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] H = new int[N];
		H[0] = sc.nextInt();
		boolean jud = true;
		
		for(int i=1;i<N;i++) {
			H[i] = sc.nextInt();
			if(H[i] > H[i-1]) {
				H[i] -= 1;
			}else if(H[i]<H[i-1]) {
				jud = false;
				break;
			}
		}
		
		if(jud) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
	}
}