import java.util.*;
import java.util.stream.*;

public class Main {
	Scanner sc;
	int N;
	int[] H;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} import java.util.*; util.* java import java.util.stream.*; stream.* java.util public class Main {
	Scanner sc;
	int N;
	int[] H;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} Main Scanner sc; sc int N; N int[] H; H //=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	} Main {
		sc = new Scanner(System.in);
	} sc = new Scanner(System.in) sc new Scanner(System.in) /**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	} calc {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	} N = sc.nextInt() N sc.nextInt() sc.nextInt sc H = new int[N] H new int[N] N int lastVal = -1; lastVal -1 1 boolean solvable = true; solvable true for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		} {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		} H[i] = sc.nextInt() H[i] H i sc.nextInt() sc.nextInt sc if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			} H[i] - 1 >= lastVal H[i] - 1 H[i] H i 1 lastVal {
				lastVal = H[i] - 1;
				continue;
			} lastVal = H[i] - 1 lastVal H[i] - 1 H[i] H i 1 continue; if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			} H[i] >= lastVal H[i] H i lastVal {
				lastVal = H[i];
				continue;
			} lastVal = H[i] lastVal H[i] H i continue; solvable = false solvable false break; out(solvable?"Yes":"No") out solvable?"Yes":"No" solvable "Yes" "No" private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	} out {
		System.out.println(o);
		System.out.flush();
	} System.out.println(o) System.out.println System.out System System.out o System.out.flush() System.out.flush System.out System System.out Object o o //======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	} main {
		Main m = new Main();
		m.calc();
	} Main m = new Main(); m new Main() m.calc() m.calc m String[] args args public class Main {
	Scanner sc;
	int N;
	int[] H;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} public class Main {
	Scanner sc;
	int N;
	int[] H;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} Main
import java.util.*;
import java.util.stream.*;

public class Main {
	Scanner sc;
	int N;
	int[] H;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		H = new int[N];
		
		int lastVal = -1;
		boolean solvable = true;
		
		for (int i = 0; i < N; i++) {
			H[i] = sc.nextInt();
			if (H[i] - 1 >= lastVal) {
				lastVal = H[i] - 1;
				continue;
			} else if (H[i] >= lastVal) {
				lastVal = H[i];
				continue;
			}
			solvable = false;
			break;
		}
		out(solvable?"Yes":"No");
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

}