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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  }
} 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  }
} 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  } 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  } 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 String s = "Yes"; s "Yes" int pre = -1; pre -1 1 for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    } {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    } if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      } pre <= h[i] - 1 pre h[i] - 1 h[i] h i 1 {
        pre = h[i] - 1;
      } pre = h[i] - 1 pre h[i] - 1 h[i] h i 1 if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      } pre <= h[i] pre h[i] h i {
        pre = h[i];
      } pre = h[i] pre h[i] h i {
        s = "No";
        break;
      } s = "No" s "No" break; System.out.println(s) System.out.println System.out System System.out s 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  }
} 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  }
} 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();
    }
    
    String s = "Yes";
    int pre = -1;
    for (int i = 0; i < n; i++) {
      if (pre <= h[i] - 1) {
        pre = h[i] - 1;
      } else if (pre <= h[i]) {
        pre = h[i];
      } else {
        s = "No";
        break;
      }
    }

    System.out.println(s);
  }
}
