
import java.util.Scanner;

/**
 *
 * @author cs18097
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
    
} import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
    
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    } main {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int high = 0; high 0 int[] poyo = new int[n]; poyo new int[n] n poyo[0] = sc.nextInt() poyo[0] poyo 0 sc.nextInt() sc.nextInt sc for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            poyo[i] = sc.nextInt();
        } {
            poyo[i] = sc.nextInt();
        } poyo[i] = sc.nextInt() poyo[i] poyo i sc.nextInt() sc.nextInt sc for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        } int i = n-1; int i = n-1; i n-1 n 1 i > 1 i 1 i-- i-- i {
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        } {
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        } if(poyo[i] < poyo[i-1])poyo[i-1]--; poyo[i] < poyo[i-1] poyo[i] poyo i poyo[i-1] poyo i-1 i 1 poyo[i-1]-- poyo[i-1] poyo i-1 i 1 for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        } {
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        } if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            } poyo[i-1]>poyo[i] poyo[i-1] poyo i-1 i 1 poyo[i] poyo i {
                System.out.print("No");
                return;
            } System.out.print("No") System.out.print System.out System System.out "No" return; System.out.print("Yes") System.out.print System.out System System.out "Yes" String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
    
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
    
} Main

import java.util.Scanner;

/**
 *
 * @author cs18097
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        int high = 0;
        int[] poyo = new int[n];
        poyo[0] = sc.nextInt();
        for(int i = 1;i < n;i++){
            poyo[i] = sc.nextInt();
        }
        for(int i = n-1;i > 1;i--){
            if(poyo[i] < poyo[i-1])poyo[i-1]--;
        }
        for(int i = 1;i < n;i++){
            if(poyo[i-1]>poyo[i]){
                System.out.print("No");
                return;
            }
        }
        System.out.print("Yes");
    }
    
}
