// template for atcode
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.util.stream.Collectors;

public class Main {

    private static final int MOD = (int)1e9 + 7; //998244353;
    // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    }
}

// Pair
class Pair<T extends Comparable<? super T>, U extends Comparable<? super U>> implements Comparable<Pair<T, U>> {
    T a;
    U b;
    Pair() { }
    Pair(T a, U b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() { return "("+a.toString()+", "+b.toString()+")"; }

    @Override
    public int hashCode() { return Objects.hash(a, b); }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) return true;
        if(obj == null) return false;
        if(this.getClass() != obj.getClass()) return false;
        Pair that = (Pair) obj;
        if(this.a.getClass() != that.a.getClass()) return false;
        if(this.b.getClass() != that.b.getClass()) return false;
        if(!this.a.equals(that.a)) return false;
        if(!this.b.equals(that.b)) return false;
        return true;
    }

    @Override
    public int compareTo(Pair<T, U> that) {
        int c = (this.a).compareTo(that.a);
        if(c == 0) c = (this.b).compareTo(that.b);
        return c;
    }
}


class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public FastScanner(InputStream stream)
    {
        this.stream = stream;
    }

    int read()
    {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    }

    boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    }

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

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

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String next(){
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c));
        return res.toString();
    }

    String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    }
} import java.util.*; util.* java import java.io.*; io.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.util.stream.Collectors; Collectors java.util.stream public class Main {

    private static final int MOD = (int)1e9 + 7; //998244353;
    // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    }
} Main private static final int MOD = (int)1e9 + 7; //998244353; MOD (int)1e9 + 7 (int)1e9 7 // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9; INF (int)1e9 public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    } Main {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int[] H = new int[N]; H new int[N] N for (int i = 0; i < N; i++) H[i] = in.nextInt(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i H[i] = in.nextInt(); H[i] = in.nextInt() H[i] H i in.nextInt() in.nextInt in for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        } int i = N - 2; int i = N - 2; i N - 2 N 2 i >= 0 i 0 i-- i-- i {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        } {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        } int x = H[i] - H[i + 1]; x H[i] - H[i + 1] H[i] H i H[i + 1] H i + 1 i 1 if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            } x > 1 x 1 {
                out.println("No");
                return;
            } out.println("No") out.println out "No" return; if (x == 1) {
                H[i]--;
            } x == 1 x 1 {
                H[i]--;
            } H[i]-- H[i] H i out.println("Yes") out.println out "Yes" FastScanner in in PrintWriter out out private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    } gcd {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    } while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        } true {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        } if (b == 0) return a; b == 0 b 0 return a; a int tmp = a; tmp a a = b a b b = tmp % b b tmp % b tmp b int a a int b b private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    } gcd {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    } while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        } true {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        } if (b == 0) return a; b == 0 b 0 return a; a long tmp = a; tmp a a = b a b b = tmp % b b tmp % b tmp b long a a long b b private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    } powm {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    } long res = 1; res 1 while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        } p > 0 p 0 {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        } if (p % 2 == 1)
                res = res * x % MOD; p % 2 == 1 p % 2 p 2 1 res = res * x % MOD res res * x % MOD res * x res x MOD x = x * x % MOD x x * x % MOD x * x x x MOD p /= 2 p 2 return res; res long x x long p p public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    } main {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    } PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) FastScanner in = new FastScanner(System.in); in new FastScanner(System.in) Main sol = new Main(in, out); sol new Main(in, out) out.close() out.close out String[] args args class Pair<T extends Comparable<? super T>, U extends Comparable<? super U>> implements Comparable<Pair<T, U>> {
    T a;
    U b;
    Pair() { }
    Pair(T a, U b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() { return "("+a.toString()+", "+b.toString()+")"; }

    @Override
    public int hashCode() { return Objects.hash(a, b); }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) return true;
        if(obj == null) return false;
        if(this.getClass() != obj.getClass()) return false;
        Pair that = (Pair) obj;
        if(this.a.getClass() != that.a.getClass()) return false;
        if(this.b.getClass() != that.b.getClass()) return false;
        if(!this.a.equals(that.a)) return false;
        if(!this.b.equals(that.b)) return false;
        return true;
    }

    @Override
    public int compareTo(Pair<T, U> that) {
        int c = (this.a).compareTo(that.a);
        if(c == 0) c = (this.b).compareTo(that.b);
        return c;
    }
} Pair T a; a U b; b Pair() { } Pair { } Pair(T a, U b) {
        this.a = a;
        this.b = b;
    } Pair {
        this.a = a;
        this.b = b;
    } this.a = a this.a this this.a a this.b = b this.b this this.b b T a a U b b @Override
    public String toString() { return "("+a.toString()+", "+b.toString()+")"; } toString { return "("+a.toString()+", "+b.toString()+")"; } return "("+a.toString()+", "+b.toString()+")"; "("+a.toString()+", "+b.toString()+")" b.toString() ", " "("+a.toString()+", "+b.toString()+")" "(" a.toString() a.toString a ", " b.toString() b.toString b ")" @Override
    public int hashCode() { return Objects.hash(a, b); } hashCode { return Objects.hash(a, b); } return Objects.hash(a, b); Objects.hash(a, b) Objects.hash Objects a b @Override
    public boolean equals(Object obj) {
        if(this == obj) return true;
        if(obj == null) return false;
        if(this.getClass() != obj.getClass()) return false;
        Pair that = (Pair) obj;
        if(this.a.getClass() != that.a.getClass()) return false;
        if(this.b.getClass() != that.b.getClass()) return false;
        if(!this.a.equals(that.a)) return false;
        if(!this.b.equals(that.b)) return false;
        return true;
    } equals {
        if(this == obj) return true;
        if(obj == null) return false;
        if(this.getClass() != obj.getClass()) return false;
        Pair that = (Pair) obj;
        if(this.a.getClass() != that.a.getClass()) return false;
        if(this.b.getClass() != that.b.getClass()) return false;
        if(!this.a.equals(that.a)) return false;
        if(!this.b.equals(that.b)) return false;
        return true;
    } if(this == obj) return true; this == obj this obj return true; true if(obj == null) return false; obj == null obj null return false; false if(this.getClass() != obj.getClass()) return false; this.getClass() != obj.getClass() this.getClass() this.getClass this obj.getClass() obj.getClass obj return false; false Pair that = (Pair) obj; that (Pair) obj if(this.a.getClass() != that.a.getClass()) return false; this.a.getClass() != that.a.getClass() this.a.getClass() this.a.getClass this.a this this.a that.a.getClass() that.a.getClass that.a that that.a return false; false if(this.b.getClass() != that.b.getClass()) return false; this.b.getClass() != that.b.getClass() this.b.getClass() this.b.getClass this.b this this.b that.b.getClass() that.b.getClass that.b that that.b return false; false if(!this.a.equals(that.a)) return false; !this.a.equals(that.a) this.a.equals(that.a) this.a.equals this.a this this.a that.a that that.a return false; false if(!this.b.equals(that.b)) return false; !this.b.equals(that.b) this.b.equals(that.b) this.b.equals this.b this this.b that.b that that.b return false; false return true; true Object obj obj @Override
    public int compareTo(Pair<T, U> that) {
        int c = (this.a).compareTo(that.a);
        if(c == 0) c = (this.b).compareTo(that.b);
        return c;
    } compareTo {
        int c = (this.a).compareTo(that.a);
        if(c == 0) c = (this.b).compareTo(that.b);
        return c;
    } int c = (this.a).compareTo(that.a); c (this.a).compareTo(that.a) (this.a).compareTo (this.a) this this.a that.a that that.a if(c == 0) c = (this.b).compareTo(that.b); c == 0 c 0 c = (this.b).compareTo(that.b) c (this.b).compareTo(that.b) (this.b).compareTo (this.b) this this.b that.b that that.b return c; c Pair<T, U> that that Comparable class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public FastScanner(InputStream stream)
    {
        this.stream = stream;
    }

    int read()
    {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    }

    boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    }

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

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

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String next(){
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c));
        return res.toString();
    }

    String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    }
} FastScanner private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars public FastScanner(InputStream stream)
    {
        this.stream = stream;
    } FastScanner {
        this.stream = stream;
    } this.stream = stream this.stream this this.stream stream InputStream stream stream int read()
    {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    } read {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    } if (numChars == -1)
            throw new InputMismatchException(); numChars == -1 numChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        } curChar >= numChars curChar numChars {
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        } curChar = 0 curChar 0 try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            } catch (IOException e) {
                throw new InputMismatchException();
            } IOException e {
                throw new InputMismatchException();
            } throw new InputMismatchException(); new InputMismatchException() {
                numChars = stream.read(buf);
            } numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if (numChars <= 0)
                return -1; numChars <= 0 numChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    } isSpaceChar {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    } return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1; c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1 c=='\t' c=='\r' c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1 c==' ' c ' ' c=='\n' c '\n' c=='\r' c '\r' c=='\t' c '\t' c==-1 c -1 1 int c c boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    } isEndline {
        return c=='\n'||c=='\r'||c==-1;
    } return c=='\n'||c=='\r'||c==-1; c=='\n'||c=='\r'||c==-1 c=='\n'||c=='\r'||c==-1 c=='\n' c '\n' c=='\r' c '\r' c==-1 c -1 1 int c c int nextInt()
    {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong()
    {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble()
    {
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String next(){
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c));
        return res.toString();
    } next {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c));
        return res.toString();
    } int c = read(); c read() read while (isSpaceChar(c))
            c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    } nextLine {
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    } int c = read(); c read() read while (isEndline(c))
            c = read(); isEndline(c) isEndline c c = read() c read() read StringBuilder res = new StringBuilder(); res new StringBuilder() do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c)); !isEndline(c) isEndline(c) isEndline c {
            res.appendCodePoint(c);
            c = read();
        } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res public class Main {

    private static final int MOD = (int)1e9 + 7; //998244353;
    // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    }
} public class Main {

    private static final int MOD = (int)1e9 + 7; //998244353;
    // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    }
} Main
// template for atcode
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.util.stream.Collectors;

public class Main {

    private static final int MOD = (int)1e9 + 7; //998244353;
    // private static final long INF = (long)1e17;
    private static final int INF = (int)1e9;

    public Main(FastScanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) H[i] = in.nextInt();
        for (int i = N - 2; i >= 0; i--) {
            int x = H[i] - H[i + 1];
            if (x > 1) {
                out.println("No");
                return;
            } else if (x == 1) {
                H[i]--;
            }
        }
        out.println("Yes");
    }

    private int gcd(int a, int b) {
        while (true) {
            if (b == 0) return a;
            int tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long gcd(long a, long b) {
        while (true) {
            if (b == 0) return a;
            long tmp = a;
            a = b;
            b = tmp % b;
        }
    }

    private long powm(long x, long p) {
        long res = 1;
        while (p > 0) {
            if (p % 2 == 1)
                res = res * x % MOD;
            x = x * x % MOD;
            p /= 2;
        }
        return res;
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        // Scanner in = new Scanner(
                // new BufferedReader(new InputStreamReader(System.in)));
        FastScanner in = new FastScanner(System.in);

        Main sol = new Main(in, out);
        out.close();
    }
}

// Pair
class Pair<T extends Comparable<? super T>, U extends Comparable<? super U>> implements Comparable<Pair<T, U>> {
    T a;
    U b;
    Pair() { }
    Pair(T a, U b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() { return "("+a.toString()+", "+b.toString()+")"; }

    @Override
    public int hashCode() { return Objects.hash(a, b); }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) return true;
        if(obj == null) return false;
        if(this.getClass() != obj.getClass()) return false;
        Pair that = (Pair) obj;
        if(this.a.getClass() != that.a.getClass()) return false;
        if(this.b.getClass() != that.b.getClass()) return false;
        if(!this.a.equals(that.a)) return false;
        if(!this.b.equals(that.b)) return false;
        return true;
    }

    @Override
    public int compareTo(Pair<T, U> that) {
        int c = (this.a).compareTo(that.a);
        if(c == 0) c = (this.b).compareTo(that.b);
        return c;
    }
}


class FastScanner{
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public FastScanner(InputStream stream)
    {
        this.stream = stream;
    }

    int read()
    {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars){
            curChar = 0;
            try{
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    boolean isSpaceChar(int c)
    {
        return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
    }

    boolean isEndline(int c)
    {
        return c=='\n'||c=='\r'||c==-1;
    }

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

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

    double nextDouble()
    {
        return Double.parseDouble(next());
    }

    String next(){
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isSpaceChar(c));
        return res.toString();
    }

    String nextLine(){
        int c = read();
        while (isEndline(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do{
            res.appendCodePoint(c);
            c = read();
        }while(!isEndline(c));
        return res.toString();
    }
}
