import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	}
} 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();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long max = a; max a for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		} int i =0; int i =0; i 0 i<N-1 i N-1 N 1 i++ i++ i {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		} {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		} long temp = sc.nextLong(); temp sc.nextLong() sc.nextLong sc if (temp<max) {
				System.out.println("No");
				return ;
			} temp<max temp max {
				System.out.println("No");
				return ;
			} System.out.println("No") System.out.println System.out System System.out "No" return ; if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			} temp >= a+1 temp a+1 a 1 {
				a = temp-1;
			} a = temp-1 a temp-1 temp 1 if (a>=temp+2) {
				System.out.println("No");
				return ;
			} a>=temp+2 a temp+2 temp 2 {
				System.out.println("No");
				return ;
			} System.out.println("No") System.out.println System.out System System.out "No" return ; max = a max a 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 sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long a = sc.nextLong();
		long max = a;
		for (int i =0;i<N-1;i++) {
			long temp = sc.nextLong();
			if (temp<max) {
				System.out.println("No");
				return ;
			}
			if (temp >= a+1) {
				a = temp-1;
			} else if (a>=temp+2) {
				System.out.println("No");
				return ;
			}
			max = a;
		}
		System.out.println("Yes");
	}
}