import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) final int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long[] h = new long[N]; h new long[N] N for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            h[i] = Long.parseLong(sc.next());
        } {
            h[i] = Long.parseLong(sc.next());
        } h[i] = Long.parseLong(sc.next()) h[i] h i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc String ans = "Yes"; ans "Yes" long pre = -1; pre -1 1 for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        } {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        } if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            } pre <= h[i]-1 pre h[i]-1 h[i] h i 1 {
                pre = h[i]-1;
            } pre = h[i]-1 pre h[i]-1 h[i] h i 1 if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            } pre <= h[i] pre h[i] h i {
                pre = h[i];
            } pre = h[i] pre h[i] h i {
                ans = "No";
                break;
            } ans = "No" ans "No" break; out.println(ans) out.println out ans out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        String ans = "Yes";
        long pre = -1;
        
        for (int i = 0; i < N; i++) {
            if (pre <= h[i]-1) {
                pre = h[i]-1;
            } else if (pre <= h[i]) {
                pre = h[i];
            } else {
                ans = "No";
                break;
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
}