import java.util.*;

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

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	}
} Main public static void main(String[] args) {

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	} main {

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int N = keyboard.nextInt(); N keyboard.nextInt() keyboard.nextInt keyboard long[] H = new long[N]; H new long[N] N for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			H[i] = keyboard.nextLong();
		} {
			H[i] = keyboard.nextLong();
		} H[i] = keyboard.nextLong() H[i] H i keyboard.nextLong() keyboard.nextLong keyboard String ans = "Yes"; ans "Yes" for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		} int n=0; int n=0; n 0 n<N n N n++ n++ n {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		} {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		} if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			} n==0 n 0 {
				H[n]--;
			} H[n]-- H[n] H n if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			} n==N-1 n N-1 N 1 {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			} if(H[n]-H[n-1]<0) {
					ans = "No";
				} H[n]-H[n-1]<0 H[n]-H[n-1] H[n] H n H[n-1] H n-1 n 1 0 {
					ans = "No";
				} ans = "No" ans "No" {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			} if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				} H[n+1]-H[n]<=-2 H[n+1]-H[n] H[n+1] H n+1 n 1 H[n] H n -2 2 {
					ans = "No";
					break;
				} ans = "No" ans "No" break; if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				} H[n]-H[n-1]>=1 H[n]-H[n-1] H[n] H n H[n-1] H n-1 n 1 1 {
					H[n]--;
				} H[n]-- H[n] H n {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				} if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					} H[n+1]-H[n]<=-1 H[n+1]-H[n] H[n+1] H n+1 n 1 H[n] H n -1 1 {
						ans = "No";
						break;
					} ans = "No" ans "No" break; System.out.println(ans) System.out.println System.out System System.out ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
	public static void main(String[] args) {

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	}
} public class Main {
	public static void main(String[] args) {

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	}
} Main
import java.util.*;

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

		Scanner keyboard = new Scanner(System.in);

		int N = keyboard.nextInt();
		long[] H = new long[N];
		
		for(int i=0; i<N; i++) {
			H[i] = keyboard.nextLong();
		}
		String ans = "Yes";
		
		for(int n=0; n<N; n++) {
			if(n==0) {
				H[n]--;
			}else if(n==N-1) {
				if(H[n]-H[n-1]<0) {
					ans = "No";
				}
			}else {
				if(H[n+1]-H[n]<=-2) {
					ans = "No";
					break;
				}
				if(H[n]-H[n-1]>=1) {
					H[n]--;
				}
				else {
					if(H[n+1]-H[n]<=-1) {
						ans = "No";
						break;
					}
				}
			}
		}
		
		System.out.println(ans);
		keyboard.close();
	}
}
