import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





}
} import java.io.BufferedReader; BufferedReader java.io import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





}
} Main public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





} main {
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc final List<Integer> list = new ArrayList<>(); list new ArrayList<>() int count = 0; count 0 for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        list.add(sc.nextInt());
    } {
        list.add(sc.nextInt());
    } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    } {
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    } if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        } list.get(i) < list.get(i+1) list.get(i) list.get list i list.get(i+1) list.get list i+1 i 1 {
            list.set(i+1, list.get(i+1)-1);
        } list.set(i+1, list.get(i+1)-1) list.set list i+1 i 1 list.get(i+1)-1 list.get(i+1) list.get list i+1 i 1 1 for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    } {
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    } if(list.get(i) > list.get(i+1)){
            count++;
        } list.get(i) > list.get(i+1) list.get(i) list.get list i list.get(i+1) list.get list i+1 i 1 {
            count++;
        } count++ count if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    } count == 0 count 0 {
        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" final String[] args args public class Main {
	public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





}
} public class Main {
	public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





}
} Main
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
        final Scanner sc = new Scanner(System.in);
        final int n = sc.nextInt();
        final List<Integer> list = new ArrayList<>();
        int count = 0;

    for(int i = 0; i < n ; i++){
        list.add(sc.nextInt());
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) < list.get(i+1)){
            list.set(i+1, list.get(i+1)-1);
        }
    }

    for(int i = 0; i < n - 1 ; i++){
        if(list.get(i) > list.get(i+1)){
            count++;
        }
    }

    if(count == 0){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }



    
  

    


    


    

    
    
    



    





}
}