import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] h = new long[N];
		for (int i = 0; i < h.length; i++) {
			h[i] = sc.nextLong();
		}
		sc.close();
		for (int i = 0; i < h.length - 1; i++) {
			if (h[i] > h[i + 1])
				h[i]--;
			else if (i != 0 && (h[i] - h[i - 1]) >= 1)
				h[i]--;
		}
		for (int i = 0; i < h.length - 1; i++) {
			if (h[i] > h[i + 1]) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

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

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] h = new long[N];
		for (int i = 0; i < h.length; i++) {
			h[i] = sc.nextLong();
		}
		sc.close();
		for (int i = 0; i < h.length - 1; i++) {
			if (h[i] > h[i + 1])
				h[i]--;
			else if (i != 0 && (h[i] - h[i - 1]) >= 1)
				h[i]--;
		}
		for (int i = 0; i < h.length - 1; i++) {
			if (h[i] > h[i + 1]) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
}