import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	}
} 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[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] arr = new int[n+1]; arr new int[n+1] n+1 n 1 arr[0] = -1 arr[0] arr 0 -1 1 for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		} int i = 1; int i = 1; i 1 i < n+1 i n+1 n 1 i++ i++ i {
			arr[i] = sc.nextInt();
		} {
			arr[i] = sc.nextInt();
		} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc String ans = "Yes"; ans "Yes" for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		} {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		} if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			} arr[i] <= arr[i+1] - 1 arr[i] arr i arr[i+1] - 1 arr[i+1] arr i+1 i 1 1 {
				arr[i+1]--;
			} arr[i+1]-- arr[i+1] arr i+1 i 1 if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			} arr[i] <= arr[i+1] arr[i] arr i arr[i+1] arr i+1 i 1 {
				continue;
			} continue; {
				ans = "No";
				break;
			} ans = "No" ans "No" break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n+1];
		arr[0] = -1;
		for(int i = 1; i < n+1; i++) {
			arr[i] = sc.nextInt();
		}
//		System.out.println(Arrays.toString(arr));
		String ans = "Yes";
		for (int i = 1; i < n; i++) {
			if (arr[i] <= arr[i+1] - 1) {
				arr[i+1]--;
			}
			else if (arr[i] <= arr[i+1]) {
				continue;
			}
			else {
				ans = "No";
				break;
			}
		}
//		System.out.println(Arrays.toString(arr));
		System.out.println(ans);
	}
}
