import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int pre = 0; pre 0 String r = "Yes"; r "Yes" for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        } {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        } int h = Integer.parseInt(sc.next()); h Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (pre > h) {
                h++;
                if (pre > h) r = "No";
            } pre > h pre h {
                h++;
                if (pre > h) r = "No";
            } h++ h if (pre > h) r = "No"; pre > h pre h r = "No" r "No" pre = h pre h System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int pre = 0;
        String r = "Yes";
        for (int i = 0; i < N; i++) {
            int h = Integer.parseInt(sc.next());
            if (pre > h) {
                h++;
                if (pre > h) r = "No";
            }
            pre = h;
        }
        System.out.println(r);
    }
}