import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	} main {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int h[] = new int[N]; h new int[N] N for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			h[i] = scan.nextInt();
		} {
			h[i] = scan.nextInt();
		} h[i] = scan.nextInt() h[i] h i scan.nextInt() scan.nextInt scan for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		} int i = 0; int i = 0; i 0 i < N - 1 i N - 1 N 1 i++ i++ i {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		} {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		} if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			} h[i + 1] < h[i] h[i + 1] h i + 1 i 1 h[i] h i {
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			} h[i + 1] > h[i] h[i + 1] h i + 1 i 1 h[i] h i {
				h[i  + 1]--;
			} h[i  + 1]-- h[i  + 1] h i  + 1 i 1 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int N = scan.nextInt();
		int h[] = new int[N];
		for(int i = 0; i < N; i++) {
			h[i] = scan.nextInt();
		}
		
		for(int i = 0; i < N - 1; i++ ) {
			if(h[i + 1] < h[i]) {
				System.out.println("No");
				return;
			}
			
			if(h[i + 1] > h[i]) {
				h[i  + 1]--;
			}
		}
		
		System.out.println("Yes");
	}
}
