import java.util.*;
public class Main{
	public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
} import java.util.*; util.* java public class Main{
	public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
} Main public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc ArrayList<Integer> al = new ArrayList<>(); al new ArrayList<>() for(int i=0;i<n;i++)
			al.add(sc.nextInt()); int i=0; int i=0; i 0 i<n i n i++ i++ i al.add(sc.nextInt()); al.add(sc.nextInt()) al.add al sc.nextInt() sc.nextInt sc for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		} int i=n-1; int i=n-1; i n-1 n 1 i>=1 i 1 i-- i-- i {
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		} {
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		} if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			} al.get(i-1)>al.get(i) al.get(i-1) al.get al i-1 i 1 al.get(i) al.get al i {
				al.set(i-1,al.get(i-1)-1);
			} al.set(i-1,al.get(i-1)-1) al.set al i-1 i 1 al.get(i-1)-1 al.get(i-1) al.get al i-1 i 1 1 boolean b=true; b true for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		} int i=0; int i=0; i 0 i<n-1 i n-1 n 1 i++ i++ i {
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		} {
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		} if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			} al.get(i+1)<al.get(i) al.get(i+1) al.get al i+1 i 1 al.get(i) al.get al i {
				System.out.println("No");
				return;
			} System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String sp[] sp public class Main{
	public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
} public class Main{
	public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
} Main
import java.util.*;
public class Main{
	public static void main(String sp[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());
		
		for(int i=n-1;i>=1;i--){
			if(al.get(i-1)>al.get(i)){
				al.set(i-1,al.get(i-1)-1);
			}
		}
		boolean b=true;
		for(int i=0;i<n-1;i++){
			if(al.get(i+1)<al.get(i)){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
}