import java.util.*;

public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
}
}
//end import java.util.*; util.* java public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
}
} Main public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
} main {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n=Integer.parseInt(scan.next()); n Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int[] h =new int[n]; h new int[n] n for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			h[i]=Integer.parseInt(scan.next());
		} {
			h[i]=Integer.parseInt(scan.next());
		} h[i]=Integer.parseInt(scan.next()) h[i] h i Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan boolean ans=true; ans true for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 ++i ++i i {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		} {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		} if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		} h[i]<h[i+1] h[i] h i h[i+1] h i+1 i 1 {
				h[i+1]=h[1+i]-1;
			} h[i+1]=h[1+i]-1 h[i+1] h i+1 i 1 h[1+i]-1 h[1+i] h 1+i 1 i 1 if (h[i]>h[i+1]) {
				ans=false;
		} h[i]>h[i+1] h[i] h i h[i+1] h i+1 i 1 {
				ans=false;
		} ans=false ans false System.out.print(ans?"Yes":"No") System.out.print System.out System System.out ans?"Yes":"No" ans "Yes" "No" String[] args args public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
}
} public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
}
} Main
import java.util.*;

public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] h =new int[n];
		for (int i=0;i<n;++i) {
			h[i]=Integer.parseInt(scan.next());
		}
		
		
		boolean ans=true;
		for(int i=0;i<n-1;++i) {
			if (h[i]<h[i+1]) {
				h[i+1]=h[1+i]-1;
			}else if (h[i]>h[i+1]) {
				ans=false;
		}
		

		}
		
		
		System.out.print(ans?"Yes":"No");

		
}
}
//end