import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			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 = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			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 = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		
		
		
		
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		
		
		
		
		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long save = Long.parseLong(sc.next()); save Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long s = 1; s 1 boolean judge = true; judge true for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		} int i=1; int i=1; i 1 i<N i N i++ i++ i {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		} {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		} s = Long.parseLong(sc.next()) s Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if (s - save > 0) {
				save = s -1;
			} s - save > 0 s - save s save 0 {
				save = s -1;
			} save = s -1 save s -1 s 1 if (s - save < 0) {
				judge = false;
				break;
			} s - save < 0 s - save s save 0 {
				judge = false;
				break;
			} judge = false judge false break; if (judge) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} judge {
			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 = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			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 = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			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 = Integer.parseInt(sc.next());
		
		
		long save = Long.parseLong(sc.next());
		
		long s = 1;
		
		boolean judge = true;
		
		for (int i=1; i<N; i++) {
			s = Long.parseLong(sc.next());
			
			if (s - save > 0) {
				save = s -1;
			}
			
			if (s - save < 0) {
				judge = false;
				break;
			}
			
		}
		
		if (judge) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		
		
		
		
		sc.close();

	}

}
