import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} Main public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } main {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } Scanner std = new Scanner(System.in); std new Scanner(System.in) int n = std.nextInt(); n std.nextInt() std.nextInt std long[] h = new long[n]; h new long[n] n for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            h[i] = std.nextInt();
        } {
            h[i] = std.nextInt();
        } h[i] = std.nextInt() h[i] h i std.nextInt() std.nextInt std boolean isNone = false; isNone false for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        } int i = n - 1; int i = n - 1; i n - 1 n 1 i > 0 i 0 i-- i-- i {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        } {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        } long diff = h[i] - h[i - 1]; diff h[i] - h[i - 1] h[i] h i h[i - 1] h i - 1 i 1 if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            } diff < 0 diff 0 {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            } diff++ diff h[i - 1] = h[i - 1] - 1 h[i - 1] h i - 1 i 1 h[i - 1] - 1 h[i - 1] h i - 1 i 1 1 if (diff < 0) {
                isNone = true;
                break;
            } diff < 0 diff 0 {
                isNone = true;
                break;
            } isNone = true isNone true break; if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        } isNone {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        long[] h = new long[n];
        for (int i = 0; i < n; i++) {
            h[i] = std.nextInt();
        }

        boolean isNone = false;
        for (int i = n - 1; i > 0; i--) {
            long diff = h[i] - h[i - 1];
            if (diff < 0) {
                diff++;
                h[i - 1] = h[i - 1] - 1;
            }

            if (diff < 0) {
                isNone = true;
                break;
            }
        }

        if (isNone) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}
