import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	}
} Main public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	} main {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int nam[] = new int[n]; nam new int[n] n int flag = 0; flag 0 for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      	nam[i] = in.nextInt();
      } {
      	nam[i] = in.nextInt();
      } nam[i] = in.nextInt() nam[i] nam i in.nextInt() in.nextInt in int bh = -999; bh -999 999 for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    } {
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    } if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      } bh<=nam[i]-1 bh nam[i]-1 nam[i] nam i 1 {
       	nam[i] -= 1 ;
      } nam[i] -= 1 nam[i] nam i 1 if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      } bh<=nam[i] bh nam[i] nam i {
       	nam[i] = nam[i];
      } nam[i] = nam[i] nam[i] nam i nam[i] nam i {
      	flag = 1;
        break;
      } flag = 1 flag 1 break; bh = nam[i] bh nam[i] nam i if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    } flag==1 flag 1 {
     	System.out.print("No"); 
    } System.out.print("No") System.out.print System.out System System.out "No" {
     	System.out.print("Yes"); 
    } System.out.print("Yes") System.out.print System.out System System.out "Yes" String[] args args public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	}
} public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	}
} Main
import java.util.*;
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
        int flag = 0;
      
      for(int i = 0; i < n ;i++){
      	nam[i] = in.nextInt();
      }
      
      int bh = -999;
      for(int i = 0;i < n ; i++){
      if(bh<=nam[i]-1){
       	nam[i] -= 1 ;
      }else if(bh<=nam[i]){
       	nam[i] = nam[i];
      }else{
      	flag = 1;
        break;
      }
        bh = nam[i];
    }

	if(flag==1){
     	System.out.print("No"); 
    }else{
     	System.out.print("Yes"); 
    }
      
	}
}
