import 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];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	}
	
} import java.util.*; util.* java public class Main {
		
	public static void main(String[] args) {		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	}
	
} Main public static void main(String[] args) {		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	} main {		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	} 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 sc.close() sc.close sc boolean out = false; out false H[0]-- H[0] H 0 for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		} int i=0; int i=0; i 0 i<N-1 i N-1 N 1 i++ i++ i {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		} {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		} if(H[i+1]<H[i]) {
				out = true;
			} H[i+1]<H[i] H[i+1] H i+1 i 1 H[i] H i {
				out = true;
			} out = true out true if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			} H[i+1]-1>=H[i] H[i+1]-1 H[i+1] H i+1 i 1 1 H[i] H i {
				H[i+1]--;
			} H[i+1]-- H[i+1] H i+1 i 1 if(out)System.out.println("No");
		else System.out.println("Yes"); out System.out.println("No") System.out.println System.out System System.out "No" System.out.println("Yes") System.out.println System.out System System.out "Yes" 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];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	}
	
} public class Main {
		
	public static void main(String[] args) {		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int H[] = new int[N];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	}
	
} Main
import 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];
		// []:配列　{2, 3 ,4}   { , , , , }
		for(int i=0;i<N;i++) {
			H[i]=sc.nextInt();
		}		
		sc.close();
		
		// 入力例　1 2 1 1 3　の時
		// H = {1, 2 ,1 ,1 3}
		boolean out = false;
		H[0]--;
		for(int i=0;i<N-1;i++) {
			
			if(H[i+1]<H[i]) {
				out = true;
			}
			
			if(H[i+1]-1>=H[i]) {
				H[i+1]--;
			}
		}
		
		if(out)System.out.println("No");
		else System.out.println("Yes");
		
//		for(int i=0;i<N;i++) {
//			System.out.print(H[i] + " ");
//		}
		
	}
	
}