4
90 91 90 91
 4
54 54 54 55
 10
55 39 93 42 97 40 36 38 11 97
 3
90 39 98
 5
21 57 40 94 17
 8
46 4 30 85 52 6 84 13
 6
47 100 96 2 96 43
 4
61 28 3 81
 5
14 91 91 91 84
 3
22 23 24
 1
13
 9
13 80 13 38 98 85 11 73 74
 10
95 51 52 8 44 39 77 17 96 88
 3
40 40 40
 4
16 17 17 18
 3
68 67 67
 4
83 100 81 75
 9
71 71 70 70 71 70 69 70 71
 10
9 9 9 10 10 9 8 8 9 9
 6
87 86 86 86 85 86
 5
64 63 63 62 61
 3
76 9 12
 4
61 60 60 60
 7
23 37 39 8 72 31 85
 10
67 67 67 67 67 67 67 67 67 67
 4
92 18 29 93
 4
14 15 15 16
 10
79 84 22 38 23 22 33 42 13 96
 7
20 21 95 73 49 98 53
 10
28 61 23 73 61 33 45 55 18 43
 9
15 14 14 13 13 12 13 13 14
 5
46 46 47 46 45
 7
35 91 87 78 17 71 63
 3
69 26 73
 10
16 17 16 15 14 15 16 17 16 15
 9
95 7 97 61 90 7 30 65 39
 10
2 83 18 65 58 95 37 51 86 47
 6
59 59 60 60 59 58

YES YES NO NO NO NO NO NO NO YES YES NO NO YES YES YES NO YES YES YES YES NO YES NO YES NO YES NO NO NO YES YES NO NO YES NO NO YES
import java.io.*;
import java.util.Arrays;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.function.Function;

public class Main {

    static int N;
    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        A = sc.nextIntArray(N);

        System.out.println(solve() ? "YES" : "NO");
    }

    static boolean solve() {
        for (int i = 1; i < N; i++) {
            if( Math.abs(A[i]-A[i-1]) > 1 ) {
                return false;
            }
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        int[] nextIntArray(int n, int delta) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt() + delta;
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static <A> void writeLines(A[] as, Function<A, String> f) {
        PrintWriter pw = new PrintWriter(System.out);
        for (A a : as) {
            pw.println(f.apply(a));
        }
        pw.flush();
    }

    static void writeLines(int[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (int a : as) pw.println(a);
        pw.flush();
    }

    static void writeLines(long[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (long a : as) pw.println(a);
        pw.flush();
    }

    static int max(int... as) {
        int max = Integer.MIN_VALUE;
        for (int a : as) max = Math.max(a, max);
        return max;
    }

    static int min(int... as) {
        int min = Integer.MAX_VALUE;
        for (int a : as) min = Math.min(a, min);
        return min;
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            if (arg instanceof int[]) j.add(Arrays.toString((int[]) arg));
            else if (arg instanceof long[]) j.add(Arrays.toString((long[]) arg));
            else if (arg instanceof double[]) j.add(Arrays.toString((double[]) arg));
            else if (arg instanceof Object[]) j.add(Arrays.toString((Object[]) arg));
            else j.add(arg.toString());
        }
        System.err.println(j.toString());
    }
}
