
import java.util.Scanner;

public class Main {

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

} import java.util.Scanner; Scanner java.util public class Main {

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

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

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

} public class Main {

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

} Main

import java.util.Scanner;

public class Main {

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

}
