import java.util.*;
public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int[]Ary;
	static int Base;
	static String ans="Yes";
	

	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    }
    //関数定義
	//public static int funk(long X,long A) {
    //    return ;    
    //}
}				 import java.util.*; util.* java public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int[]Ary;
	static int Base;
	static String ans="Yes";
	

	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    }
    //関数定義
	//public static int funk(long X,long A) {
    //    return ;    
    //}
} Main //定義関数から参照できる変数定義はこの辺
	static int N; N static int[]Ary; Ary static int Base; Base static String ans="Yes"; ans "Yes" public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    } main {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc Ary = new int[N+1] Ary new int[N+1] N+1 N 1 for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			Ary[i] = sc.nextInt();
		} {
			Ary[i] = sc.nextInt();
		} Ary[i] = sc.nextInt() Ary[i] Ary i sc.nextInt() sc.nextInt sc Base=Ary[1] Base Ary[1] Ary 1 for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		} {
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		} if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			} Base<=Ary[i] Base Ary[i] Ary i {
				Base=Ary[i];


			} Base=Ary[i] Base Ary[i] Ary i {
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			} if ((Base-Ary[i])>=2) {
					ans="No";
				} (Base-Ary[i])>=2 (Base-Ary[i]) Base Ary[i] Ary i 2 {
					ans="No";
				} ans="No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int[]Ary;
	static int Base;
	static String ans="Yes";
	

	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    }
    //関数定義
	//public static int funk(long X,long A) {
    //    return ;    
    //}
} public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int[]Ary;
	static int Base;
	static String ans="Yes";
	

	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    }
    //関数定義
	//public static int funk(long X,long A) {
    //    return ;    
    //}
} Main
import java.util.*;
public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int[]Ary;
	static int Base;
	static String ans="Yes";
	

	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		Ary = new int[N+1];
		for(int i=1;i<=N;i++){
			Ary[i] = sc.nextInt();
		}

		Base=Ary[1];
		for(int i=1;i<=N;i++){
			
			if (Base<=Ary[i]) {
				Base=Ary[i];


			}
			else{
				if ((Base-Ary[i])>=2) {
					ans="No";
				}
			}
		}
		System.out.println(ans);
		//System.out.print(ans);
    }
    //関数定義
	//public static int funk(long X,long A) {
    //    return ;    
    //}
}				