import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			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 scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} main {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) final int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan long[] h = new long[N]; h new long[N] N for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			h[i] = scan.nextLong();
		} {
			h[i] = scan.nextLong();
		} h[i] = scan.nextLong() h[i] h i scan.nextLong() scan.nextLong scan scan.close() scan.close scan boolean flg = true; flg true for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		} int i = N - 2; int i = N - 2; i N - 2 N 2 i >= 0 i 0 i-- i-- i {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		} {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		} if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			} h[i] - h[i + 1] == 1 h[i] - h[i + 1] h[i] h i h[i + 1] h i + 1 i 1 1 {
				h[i]--;
			} h[i]-- h[i] h i if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			} h[i] - h[i + 1] >= 2 h[i] - h[i + 1] h[i] h i h[i + 1] h i + 1 i 1 2 {
				flg = false;
				break;
			} flg = false flg false break; if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		} flg {
			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 scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final int N = scan.nextInt();
		long[] h = new long[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextLong();
		}
		scan.close();
		boolean flg = true;
		// 末尾から見ていく
		for(int i = N - 2; i >= 0; i--) {
			if(h[i] - h[i + 1] == 1) {
				h[i]--;
			}else if(h[i] - h[i + 1] >= 2 ) {
				flg = false;
				break;
			}
		}
		if(flg) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}
