import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] h = new int[n]; h new int[n] n for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h[i] = sc.nextInt();
        } {
            h[i] = sc.nextInt();
        } h[i] = sc.nextInt() h[i] h i sc.nextInt() sc.nextInt sc int min = 0; min 0 for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        } {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        } int x = h[i] -1; x h[i] -1 h[i] h i 1 if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            } h[i] < min h[i] h i min {
                min = -1;
                break;
            } min = -1 min -1 1 break; if(min < x){
                min = x;
            } min < x min x {
                min = x;
            } min = x min x System.out.println(min < 0 ? "No" : "Yes") System.out.println System.out System System.out min < 0 ? "No" : "Yes" min < 0 min 0 "No" "Yes" sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        int min = 0;
        for (int i = 0; i < n; i++) {
            int x = h[i] -1;
            if(h[i] < min){
                min = -1;
                break;
            }else if(min < x){
                min = x;
            }
        }
        System.out.println(min < 0 ? "No" : "Yes");
        sc.close();

    }

}
