import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    }

} Main public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(is); reader new BufferedReader(is) List<String> mylist = new ArrayList<>(); mylist new ArrayList<>() String strinput = reader.readLine(); strinput reader.readLine() reader.readLine reader while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        } strinput != null strinput null {

            mylist.add(strinput);
            strinput = reader.readLine();

        } mylist.add(strinput) mylist.add mylist strinput strinput = reader.readLine() strinput reader.readLine() reader.readLine reader String arr01[] = mylist.get(0).split(" "); arr01 mylist.get(0).split(" ") mylist.get(0).split mylist.get(0) mylist.get mylist 0 " " String arr02[] = mylist.get(1).split(" "); arr02 mylist.get(1).split(" ") mylist.get(1).split mylist.get(1) mylist.get mylist 1 " " int n = Integer.valueOf(arr01[0]); n Integer.valueOf(arr01[0]) Integer.valueOf Integer arr01[0] arr01 0 Boolean chkflg = true; chkflg true for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        } int i = 0; int i = 0; i 0 i < n - 2 i n - 2 n 2 i++ i++ i {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        } {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        } int temp1 = Integer.valueOf(arr02[i]); temp1 Integer.valueOf(arr02[i]) Integer.valueOf Integer arr02[i] arr02 i int temp2 = Integer.valueOf(arr02[i + 1]); temp2 Integer.valueOf(arr02[i + 1]) Integer.valueOf Integer arr02[i + 1] arr02 i + 1 i 1 int temp3 = Integer.valueOf(arr02[i + 2]); temp3 Integer.valueOf(arr02[i + 2]) Integer.valueOf Integer arr02[i + 2] arr02 i + 2 i 2 if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            } temp1 < temp2 temp1 temp2 {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } temp2 -= 1 temp2 1 arr02[i + 1] = String.valueOf(temp2) arr02[i + 1] arr02 i + 1 i 1 String.valueOf(temp2) String.valueOf String temp2 if (temp2 > temp3) {
                    chkflg = false;
                    break;

                } temp2 > temp3 temp2 temp3 {
                    chkflg = false;
                    break;

                } chkflg = false chkflg false break; if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            } temp1 == temp2 temp1 temp2 {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } if (temp2 > temp3) {
                    chkflg = false;
                    break;
                } temp2 > temp3 temp2 temp3 {
                    chkflg = false;
                    break;
                } chkflg = false chkflg false break; {
                chkflg = false;
                break;
            } chkflg = false chkflg false break; System.out.println(chkflg ? "Yes" : "No") System.out.println System.out System System.out chkflg ? "Yes" : "No" chkflg "Yes" "No" String[] args args public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    }

} public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        int n = Integer.valueOf(arr01[0]);

        Boolean chkflg = true;

        for (int i = 0; i < n - 2; i++) {
            int temp1 = Integer.valueOf(arr02[i]);
            int temp2 = Integer.valueOf(arr02[i + 1]);
            int temp3 = Integer.valueOf(arr02[i + 2]);

            if (temp1 < temp2) {
                temp2 -= 1;
                arr02[i + 1] = String.valueOf(temp2);

                if (temp2 > temp3) {
                    chkflg = false;
                    break;

                }

            } else if (temp1 == temp2) {
                if (temp2 > temp3) {
                    chkflg = false;
                    break;
                }
            } else {
                chkflg = false;
                break;
            }
        }

        System.out.println(chkflg ? "Yes" : "No");

    }

}
