import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        } {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        } int now = sc.nextInt(); now sc.nextInt() sc.nextInt sc if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            } max - 1 > now max - 1 max 1 now {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; if (now > max) {
                max = now;
            } now > max now max {
                max = now;
            } max = now max now System.out.println("Yes") System.out.println System.out System System.out "Yes" sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = sc.nextInt();

        for (int i = 0; i < n - 1; i++) {
            int now = sc.nextInt();
            if (max - 1 > now) {
                System.out.println("No");
                return;
            } else if (now > max) {
                max = now;
            }
        }

        System.out.println("Yes");

        sc.close();

    }

}