import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} import java.util.Scanner; Scanner 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];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } 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 boolean ans = true; ans true int tmp = 0; tmp 0 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 for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    } {
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    } if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      } tmp < h[j] tmp h[j] h j {
        h[j]--;
        tmp = h[j];
      } h[j]-- h[j] h j tmp = h[j] tmp h[j] h j if(tmp > h[j]){
        ans = false;
        break;
      } tmp > h[j] tmp h[j] h j {
        ans = false;
        break;
      } ans = false ans false break; if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    } ans {
      System.out.println("Yes");
    } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
      System.out.println("No");
    } System.out.println("No") System.out.println System.out System System.out "No" 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];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] h = new int[n];
    boolean ans = true;
    int tmp = 0;
    for(int i = 0;i < n;i++){
      h[i] = sc.nextInt();
    }
    for(int j = 0;j < n;j++){
      if(tmp < h[j]){
        h[j]--;
        tmp = h[j];
      }else if(tmp > h[j]){
        ans = false;
        break;
      }
    }
    if(ans){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}
