import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    public static final PrintStream out = System.out;

    public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintStream; PrintStream java.io import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {
    public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    public static final PrintStream out = System.out;

    public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    }
} Main public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) public static final PrintStream out = System.out; out System.out System System.out public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    } main {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        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] = in.nextInt() H[i] H i in.nextInt() in.nextInt in int step = 0; step 0 for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        } int i H {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        } {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        } if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            } i < step i step {
                out.println("No");
                return;
            } out.println("No") out.println out "No" return; if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            } i <= step + 1 i step + 1 step 1 {
                continue;
            } continue; {
                step = i - 1;
            } step = i - 1 step i - 1 i 1 out.println("Yes") out.println out "Yes" String[] args args public class Main {
    public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    public static final PrintStream out = System.out;

    public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    }
} public class Main {
    public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    public static final PrintStream out = System.out;

    public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    public static final PrintStream out = System.out;

    public static void main(String[] args) {
        int N = in.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = in.nextInt();
        }

        int step = 0;
        for (int i : H) {
            if (i < step) {
                out.println("No");
                return;
            } else if (i <= step + 1) {
                continue;
            } else {
                step = i - 1;
            }
        }
        out.println("Yes");
    }
}
