import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H[] = new int[N];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    }
} import java.util.Scanner; Scanner 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];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H[] = new int[N];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    } main {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H[] = new int[N];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    } 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 String result = "Yes"; result "Yes" int count = 0; count 0 int min = 0; min 0 for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        } int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        } {
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        } H[i] = sc.nextInt() H[i] H i sc.nextInt() sc.nextInt sc if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            } i == 0 i 0 {
                min = H[0]-1;
            } min = H[0]-1 min H[0]-1 H[0] H 0 1 if (min <H[i]-1){

                min = H[i]-1;
            } min <H[i]-1 min H[i]-1 H[i] H i 1 {

                min = H[i]-1;
            } min = H[i]-1 min H[i]-1 H[i] H i 1 if(H[i]<min){
                result = "No";
                break;
            } H[i]<min H[i] H i min {
                result = "No";
                break;
            } result = "No" result "No" break; System.out.println(result) System.out.println System.out System System.out result 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];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H[] = new int[N];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int H[] = new int[N];
        String result = "Yes";
        int count = 0;
        int min = 0;
        for (int i = 0; i< N; i++){
            H[i] = sc.nextInt();
            if (i == 0){
                min = H[0]-1;
            }else if (min <H[i]-1){

                min = H[i]-1;
            }
            if(H[i]<min){
                result = "No";
                break;
            }



//            if (i>0&&H[i-1] > H[i]){
//                if(count >0){
//                    result = "No";
//                    break;
//                }
//                count ++;
//            }
        }

        System.out.println(result);


    }
}
