import java.io.PrintWriter;
import java.util.Scanner;

public class Main{

	public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} Main public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	} main {
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	} 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] h i sc.nextInt() sc.nextInt sc sc.close() sc.close sc String ans = "Yes"; ans "Yes" for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		} int i = n-2; int i = n-2; i n-2 n 2 i >= 0 i 0 i-- i-- i {
			if(h[i] > h[i+1]){
				h[i]--;
			}
		} {
			if(h[i] > h[i+1]){
				h[i]--;
			}
		} if(h[i] > h[i+1]){
				h[i]--;
			} h[i] > h[i+1] h[i] h i h[i+1] h i+1 i 1 {
				h[i]--;
			} h[i]-- h[i] h i for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		} int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
			if(h[i] > h[i+1]) ans = "No";
		} {
			if(h[i] > h[i+1]) ans = "No";
		} if(h[i] > h[i+1]) ans = "No"; h[i] > h[i+1] h[i] h i h[i+1] h i+1 i 1 ans = "No" ans "No" PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(ans) out.println out ans out.flush() out.flush out String[] args args public class Main{

	public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} public class Main{

	public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{

	public static void main(String[] args){
		//入力
		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();
		sc.close();

		//処理
		String ans = "Yes";
		for(int i = n-2; i >= 0; i--){
			if(h[i] > h[i+1]){
				h[i]--;
			}
		}
		for(int i = 0; i < n-1; i++){
			if(h[i] > h[i+1]) ans = "No";
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
}