import java.util.*;

public class Main {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
} Main public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    } main {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    } Scanner read = new Scanner(System.in); read new Scanner(System.in) int n = read.nextInt(); n read.nextInt() read.nextInt read int d[] = new int[n]; d new int[n] n d[0] = read.nextInt()-1 d[0] d 0 read.nextInt()-1 read.nextInt() read.nextInt read 1 boolean ban=true; ban true for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    } int i=1; int i=1; i 1 i<n i n i++ i++ i {
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    } {
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    } d[i]=read.nextInt() d[i] d i read.nextInt() read.nextInt read if(d[i-1] > d[i]){
            ban=false;
            break;
        } d[i-1] > d[i] d[i-1] d i-1 i 1 d[i] d i {
            ban=false;
            break;
        } ban=false ban false break; if(d[i-1] < d[i])
            --d[i]; d[i-1] < d[i] d[i-1] d i-1 i 1 d[i] d i --d[i] d[i] d i if(ban)
           System.out.println("Yes");
        else
           System.out.println("No"); ban System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String args[] args public class Main {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
} public class Main {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) {
    Scanner read = new Scanner(System.in);
    int n = read.nextInt();
    int d[] = new int[n];
    d[0] = read.nextInt()-1;
    boolean ban=true;
    for(int i=1; i<n; i++){
        d[i]=read.nextInt();
        if(d[i-1] > d[i]){
            ban=false;
            break;
        }
        if(d[i-1] < d[i])
            --d[i];
    }
    
        if(ban)
           System.out.println("Yes");
        else
           System.out.println("No");
    
    
    
   
    }
}