import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) sc.next() sc.next sc int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int current = a; current a int next = 0; next 0 boolean can = true; can true int sa = 0; sa 0 String result = "Yes"; result "Yes" while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		} sc.hasNext() sc.hasNext sc {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		} next = Integer.parseInt(sc.next()) next Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(can) current--; can current-- current sa = current - next sa current - next current next if(sa>0) {
				result = "No";
				break;
			} sa>0 sa 0 {
				result = "No";
				break;
			} result = "No" result "No" break; if(current<next) {
				can = true;
			}else {
				can = false;
			} current<next current next {
				can = true;
			} can = true can true {
				can = false;
			} can = false can false current = next current next System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		sc.next();
		int a = Integer.parseInt(sc.next());
		int current = a;
		int next = 0;
		boolean can = true;
		int sa = 0;
		String result = "Yes";
		while(sc.hasNext()) {
			next = Integer.parseInt(sc.next());
			if(can) current--;
			sa = current - next;
			if(sa>0) {
				result = "No";
				break;
			}
			if(current<next) {
				can = true;
			}else {
				can = false;
			}
			current = next;
		}
		System.out.println(result);
	}
}