import java.util.*;
 
public class Main {
  public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} import java.util.*; util.* java public class Main {
  public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } main {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int H[] = new int[N]; H new int[N] N int Max = 0; Max 0 for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      H[i] = scan.nextInt();
    } {
      H[i] = scan.nextInt();
    } H[i] = scan.nextInt() H[i] H i scan.nextInt() scan.nextInt scan for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    } {
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    } if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      } H[i]-1 > Max H[i]-1 H[i] H i 1 Max {
        Max = H[i]-1;
      } Max = H[i]-1 Max H[i]-1 H[i] H i 1 if(H[i] < Max){
        System.out.println("No");
        return;
      } H[i] < Max H[i] H i Max {
        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[] arg arg public class Main {
  public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} public class Main {
  public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
} Main
import java.util.*;
 
public class Main {
  public static void main (String[] arg) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int H[] = new int[N];
    int Max = 0;
    
    for (int i = 0; i < N; i++){
      H[i] = scan.nextInt();
    }
    
    for (int i = 0; i < N; i++){
      if(H[i]-1 > Max){
        Max = H[i]-1;
      } else if(H[i] < Max){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
}