import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  }

} 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[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  }

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

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  } main {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

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

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] H = new int[N];

    for (int i = 0; i < N; i++) {
      H[i] = sc.nextInt();
    }

    sc.close();

    String result = "Yes";

    for (int i = N - 1; 0 < i; i--) {
      if (H[i] < H[i - 1]) {
        if (H[i - 1] - H[i] <= 1) {
          H[i - 1] -= H[i - 1] - H[i];
        } else {
          result = "No";
          break;
        }
      }
    }

    System.out.println(result);

  }

}