import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) 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();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) 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();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) 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 int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc boolean ans = true; ans true for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		} {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		} int ne = sc.nextInt(); ne sc.nextInt() sc.nextInt sc if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			} max - ne > 1 max - ne max ne 1 {
				ans = false;
				break;
			} ans = false ans false break; if(max < ne) {
				max = ne;
			} max < ne max ne {
				max = ne;
			} max = ne max ne if(ans) System.out.println("Yes");
		else System.out.println("No"); ans System.out.println("Yes") System.out.println System.out System System.out "Yes" 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();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) 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();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) 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();
		int max = sc.nextInt();
		boolean ans = true;
		for(int i = 1; i < N; i++) {
			int ne = sc.nextInt();
			if(max - ne > 1) {
				ans = false;
				break;
			}else if(max < ne) {
				max = ne;
			}
		}
		if(ans) System.out.println("Yes");
		else System.out.println("No");
	}
}