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 = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	}

} 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 = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int max = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	} main {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int max = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int max = 0; max 0 boolean flag = true; flag true for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		} {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		} int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc if(max - p >= 2) {
				flag = false;
				break;
			} max - p >= 2 max - p max p 2 {
				flag = false;
				break;
			} flag = false flag false break; if(max - p == 1) {
				// 何もしない
				continue;
			} max - p == 1 max - p max p 1 {
				// 何もしない
				continue;
			} continue; max = p max p 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" sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int max = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		int max = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	}

} 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 = 0;
		boolean flag = true;
		
		for(int i=0; i<N ; i++) {
			int p = sc.nextInt();
			if(max - p >= 2) {
				flag = false;
				break;
			}
			if(max - p == 1) {
				// 何もしない
				continue;
			}
			max = p;
		}
		
		if(flag) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		sc.close();	
	}

}