import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int [] in = new int [a+1]; in new int [a+1] a+1 a 1 in[0] = 0 in[0] in 0 0 String s = "Yes"; s "Yes" for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              } int i=1; int i=1; i 1 i<a+1 i a+1 a 1 i++ i++ i {
                               in[i] = sc.nextInt();
                              } {
                               in[i] = sc.nextInt();
                              } in[i] = sc.nextInt() in[i] in i sc.nextInt() sc.nextInt sc for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              } int i=1; int i=1; i 1 i<a+1 i a+1 a 1 i++ i++ i {if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              } {if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              } if(in[i]<in[i-1]){s="No";break;
                                                } in[i]<in[i-1] in[i] in i in[i-1] in i-1 i 1 {s="No";break;
                                                } s="No" s "No" break; if(in[i]>in[i-1]){in[i]--;} in[i]>in[i-1] in[i] in i in[i-1] in i-1 i 1 {in[i]--;} in[i]-- in[i] in i System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a+1];
        in[0] = 0;
        String s = "Yes";
        for(int i=1;i<a+1;i++){
                               in[i] = sc.nextInt();
                              }
        for(int i=1;i<a+1;i++){if(in[i]<in[i-1]){s="No";break;
                                                }
                              if(in[i]>in[i-1]){in[i]--;}
                              }      
		System.out.println(s);
	}
}
