import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} main {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	} int Num; Num Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Num = sc.nextInt() Num sc.nextInt() sc.nextInt sc int[] NumArray = new int[Num]; NumArray new int[Num] Num for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		} int i = 0; int i = 0; i 0 i < Num i Num i++ i++ i {

			NumArray[i] = sc.nextInt();

		} {

			NumArray[i] = sc.nextInt();

		} NumArray[i] = sc.nextInt() NumArray[i] NumArray i sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		} int i = 1; int i = 1; i 1 i < NumArray.length i NumArray.length NumArray NumArray.length i++ i++ i {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		} {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		} if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			} NumArray[i-1] < NumArray[i] NumArray[i-1] NumArray i-1 i 1 NumArray[i] NumArray i {

				++count;
				NumArray[i] = NumArray[i] -1;

			} ++count count NumArray[i] = NumArray[i] -1 NumArray[i] NumArray i NumArray[i] -1 NumArray[i] NumArray i 1 if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			} NumArray[i-1] == NumArray[i] NumArray[i-1] NumArray i-1 i 1 NumArray[i] NumArray i {

				++count;

			} ++count count {
				break;
			} break; if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} count == NumArray.length -1 count NumArray.length -1 NumArray.length NumArray NumArray.length 1 {
			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" String[] args args public class Main {
	public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} public class Main {
	public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		int Num;

		Scanner sc = new Scanner(System.in);

		Num = sc.nextInt();

		int[] NumArray = new int[Num];

		for (int i = 0; i < Num; i++) {

			NumArray[i] = sc.nextInt();

		}

		int count = 0;

		for (int i = 1; i < NumArray.length; i++) {

			if (NumArray[i-1] < NumArray[i]) {

				++count;
				NumArray[i] = NumArray[i] -1;

			} else if (NumArray[i-1] == NumArray[i]) {

				++count;

			} else {
				break;
			}

		}

		if (count == NumArray.length -1) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
