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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	}
} 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	}
} 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	} 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	} 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 scan.close() scan.close scan int check=1; check 1 if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		} n!=1 n 1 {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		} for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					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]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			} {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			} if(h[i] > h[i+1]) h[i]--; h[i] > h[i+1] h[i] h i h[i+1] h i+1 i 1 h[i]-- h[i] h i if(h[i] > h[i+1]) {
					check=0;
					break;
				} h[i] > h[i+1] h[i] h i h[i+1] h i+1 i 1 {
					check=0;
					break;
				} check=0 check 0 break; System.out.println((check == 1)? "Yes":"No") System.out.println System.out System System.out (check == 1)? "Yes":"No" (check == 1) check 1 "Yes" "No" 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	}
} 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	}
} 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();
		}
		scan.close();
		int check=1;
		if(n!=1) {
			for(int i=n-2;i>=0;i--) {
				if(h[i] > h[i+1]) h[i]--;
				if(h[i] > h[i+1]) {
					check=0;
					break;
				}
			}
		}
		System.out.println((check == 1)? "Yes":"No");
	}
}