import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} 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.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.nextLine()); N Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String[] spl = sc.nextLine().split(" "); spl sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int[] h = new int[N]; h new int[N] N for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			h[i] = Integer.parseInt(spl[i]);
		} {
			h[i] = Integer.parseInt(spl[i]);
		} h[i] = Integer.parseInt(spl[i]) h[i] h i Integer.parseInt(spl[i]) Integer.parseInt Integer spl[i] spl i sc.close() sc.close sc String ans = "Yes"; ans "Yes" for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		} int i = N-1; int i = N-1; i N-1 N 1 i > 0 i 0 i-- i-- i {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		} {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		} if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			} h[i] - h[i-1] < 0 h[i] - h[i-1] h[i] h i h[i-1] h i-1 i 1 0 {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			} h[i-1] -= 1 h[i-1] h i-1 i 1 1 if(h[i] - h[i-1] < 0) {
					ans = "No";
				} h[i] - h[i-1] < 0 h[i] - h[i-1] h[i] h i h[i-1] h i-1 i 1 0 {
					ans = "No";
				} ans = "No" ans "No" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
} 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.nextLine());
		String[] spl = sc.nextLine().split(" ");
		int[] h = new int[N];
		for(int i = 0;i < N;i++) {
			h[i] = Integer.parseInt(spl[i]);
		}
		sc.close();

		String ans = "Yes";
		for(int i = N-1;i > 0;i--) {
			if(h[i] - h[i-1] < 0) {
				h[i-1] -= 1;
				if(h[i] - h[i-1] < 0) {
					ans = "No";
				}
			}
		}
		System.out.println(ans);
	}
}