import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	}

	private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	}

	private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n = in.nextInt(); n in.nextInt() in.nextInt in int[] h = new int[n]; h new int[n] n for (int i = 0; i < n; i++)
			h[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i h[i] = in.nextInt(); h[i] = in.nextInt() h[i] h i in.nextInt() in.nextInt in System.out.println(solve(n, h)) System.out.println System.out System System.out solve(n, h) solve n h in.close() in.close in String[] args args private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	} solve {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	} h[0]-- h[0] h 0 for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No"; int i = 1; int i = 1; i 1 i < n i n i++ i++ i if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No"; if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No"; 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])
				return "No"; h[i] < h[i - 1] h[i] h i h[i - 1] h i - 1 i 1 return "No"; "No" return "Yes"; "Yes" int n n int[] h h public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	}

	private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	}

	private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++)
			h[i] = in.nextInt();
		System.out.println(solve(n, h));
		in.close();
	}

	private static String solve(int n, int[] h) {
		h[0]--;
		for (int i = 1; i < n; i++)
			if (h[i] > h[i - 1])
				h[i]--;
			else if (h[i] < h[i - 1])
				return "No";
		return "Yes";
	}
}