import java.util.Scanner;

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

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int[] h = new int[N]; h new int[N] N for (int i = 0; i < N; i++) h[i] = scanner.nextInt(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i h[i] = scanner.nextInt(); h[i] = scanner.nextInt() h[i] h i scanner.nextInt() scanner.nextInt scanner for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    } int i = N - 1; int i = N - 1; i N - 1 N 1 i >= 1 i 1 i-- i-- i {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    } {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    } if (h[i] < h[i - 1]) h[i - 1]--; h[i] < h[i - 1] h[i] h i h[i - 1] h i - 1 i 1 h[i - 1]-- h[i - 1] h i - 1 i 1 if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      } h[i] < h[i - 1] h[i] h i h[i - 1] h i - 1 i 1 {
        System.out.println("No");
        return;
      } System.out.println("No") System.out.println System.out System System.out "No" return; 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 scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main
import java.util.Scanner;

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

    int N = scanner.nextInt();
    int[] h = new int[N];
    for (int i = 0; i < N; i++) h[i] = scanner.nextInt();

    for (int i = N - 1; i >= 1; i--) {
      if (h[i] < h[i - 1]) h[i - 1]--;
      if (h[i] < h[i - 1]) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
}
