import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    }

} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    }

} Main public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    } main {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    } try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        } {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        } BufferedInputStream in = new BufferedInputStream(System.in) BufferedInputStream in = new BufferedInputStream(System.in) new BufferedInputStream(System.in) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) new PrintWriter(new BufferedOutputStream(System.out)) Scanner sc = new Scanner(in); sc new Scanner(in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int last = sc.nextInt() - 1; last sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            } {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            } int cur = sc.nextInt(); cur sc.nextInt() sc.nextInt sc if (cur < last) {
                    out.println("No");
                    return;
                } cur < last cur last {
                    out.println("No");
                    return;
                } out.println("No") out.println out "No" return; if (cur > last) cur--; cur > last cur last cur-- cur last = cur last cur out.println("Yes") out.println out "Yes" String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    }

} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    }

} Main
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:44-

            int n = sc.nextInt();
            int last = sc.nextInt() - 1;
            for (int i = 1; i < n; i++) {
                int cur = sc.nextInt();
                if (cur < last) {
                    out.println("No");
                    return;
                }
                if (cur > last) cur--;
                last = cur;
            }

            out.println("Yes");
        }
    }

}
