import java.util.*;
import java.lang.*;

public class Main {
    static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    }
} Main static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    } answer {
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    } System.out.println(ans ? "Yes" : "No") System.out.println System.out System System.out ans ? "Yes" : "No" ans "Yes" "No" System.exit(0) System.exit System 0 boolean ans ans public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] H = new long[N+1]; H new long[N+1] N+1 N 1 for(int n=1; n<=N; n++) H[n]=sc.nextLong(); int n=1; int n=1; n 1 n<=N n N n++ n++ n H[n]=sc.nextLong(); H[n]=sc.nextLong() H[n] H n sc.nextLong() sc.nextLong sc for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        } int n=1; int n=1; n 1 n<=N n N n++ n++ n {
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        } {
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        } if(H[n-1] > H[n]) answer(false); H[n-1] > H[n] H[n-1] H n-1 n 1 H[n] H n answer(false) answer false if(H[n-1] < H[n]) H[n]--; H[n-1] < H[n] H[n-1] H n-1 n 1 H[n] H n H[n]-- H[n] H n answer(true) answer true String[] args args public class Main {
    static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    }
} public class Main {
    static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {
    static void answer(boolean ans){
        System.out.println(ans ? "Yes" : "No");
        System.exit(0);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] H = new long[N+1];
        for(int n=1; n<=N; n++) H[n]=sc.nextLong();

        for(int n=1; n<=N; n++){
            if(H[n-1] > H[n]) answer(false);
            if(H[n-1] < H[n]) H[n]--;
        }
        answer(true);
    }
}
