
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;
import java.util.regex.Pattern;






public class Main {

	
	 
	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		}
		
	 
		
	} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java import java.util.Stack; Stack java.util import java.util.regex.Pattern; Pattern java.util.regex public class Main {

	
	 
	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		}
		
	 
		
	} Main public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out)); out new PrintWriter (new BufferedOutputStream(System.out)) static long mod = (long) (1e9+7); mod (long) (1e9+7) 1e9 7 static int N = (int) 1e5; N (int) 1e5 public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		} main {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		} FastReader sc = new FastReader(); sc new FastReader() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] h = new int[n]; h new int[n] n for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			} int i=0; int i=0; i 0 i<n i n ++i ++i i {
				h[i] = sc.nextInt();
			} {
				h[i] = sc.nextInt();
			} h[i] = sc.nextInt() h[i] h i sc.nextInt() sc.nextInt sc boolean yes = true; yes true h[0]-- h[0] h 0 for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		} int i=1; int i=1; i 1 i<n && yes i<n i n yes ++i ++i i {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		} {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		} if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false; h[i]-1>=h[i-1] h[i]-1 h[i] h i 1 h[i-1] h i-1 i 1 h[i]-- h[i] h i if(h[i]<h[i-1]) yes = false; h[i]<h[i-1] h[i] h i h[i-1] h i-1 i 1 yes = false yes false if(yes) out.print("Yes");
		 else  out.print("No"); yes out.print("Yes") out.print out "Yes" out.print("No") out.print out "No" out.close() out.close out String[] args args public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	} FastReader BufferedReader br; br StringTokenizer st; st public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		} FastReader {
			br = new BufferedReader(new InputStreamReader(System.in));
		} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		} next {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		} while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			} st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			} try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				} catch (Exception r) {
					r.printStackTrace();
				} Exception r {
					r.printStackTrace();
				} r.printStackTrace() r.printStackTrace r {
					st = new StringTokenizer(br.readLine());
				} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		} nextInt {
			return Integer.parseInt(next());//converts string to integer
		} return Integer.parseInt(next());//converts string to integer Integer.parseInt(next()) Integer.parseInt Integer next() next double nextDouble() {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next long nextLong() {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		} nextLine {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		} String str = ""; str "" try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			} catch (Exception r) {
				r.printStackTrace();
			} Exception r {
				r.printStackTrace();
			} r.printStackTrace() r.printStackTrace r {
				str = br.readLine();
			} str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

	
	 
	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		}
		
	 
		
	} public class Main {

	
	 
	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		}
		
	 
		
	} Main

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;
import java.util.regex.Pattern;






public class Main {

	
	 
	
	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;
		//it reads the data about the specified point and divide the data about it ,it is quite fast
		//than using direct 

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());//converts string to integer
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static long mod = (long) (1e9+7);
	static int N = (int) 1e5;
	public static void main(String[] args) {
		 FastReader sc = new FastReader();
		 int n = sc.nextInt();
		 int[] h = new int[n];
			for(int i=0;i<n;++i) {
				h[i] = sc.nextInt();
			}
			boolean yes = true;
			h[0]--;
		for(int i=1;i<n && yes;++i) {
			
			if(h[i]-1>=h[i-1]) h[i]--;
			else if(h[i]<h[i-1]) yes = false;
		}
		
		 if(yes) out.print("Yes");
		 else  out.print("No");
			 out.close();
		}
		
	 
		
	}