import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} 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();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] H = new long[N+1]; H new long[N+1] N+1 N 1 for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			H[i] = sc.nextLong();
		} {
			H[i] = sc.nextLong();
		} H[i] = sc.nextLong() H[i] H i sc.nextLong() sc.nextLong sc sc.close() sc.close sc boolean flag = true; flag true for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		} int i=N-1; int i=N-1; i N-1 N 1 i>0 i 0 i-- i-- i {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		} {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		} if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			} H[i]< H[i-1] H[i] H i H[i-1] H i-1 i 1 {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			} if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				} 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 {
					flag = false;
					break;
				} flag = false flag false break; if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		} flag {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		long[] H = new long[N+1];
		for(int i=0; i<N; i++) {
			H[i] = sc.nextLong();
		}
		sc.close();

		boolean flag = true;

		for(int i=N-1; i>0; i--) {
			if(H[i]< H[i-1]) {
				if(H[i-1]-1 <= H[i]) {
					H[i-1]--;
				}else {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}