import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] h = new int[n];
        boolean ans = true;
        for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        }
        int tmp = h[0];
        for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] h = new int[n];
        boolean ans = true;
        for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        }
        int tmp = h[0];
        for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] h = new int[n];
        boolean ans = true;
        for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        }
        int tmp = h[0];
        for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        }
        System.out.println(ans?"Yes":"No");
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] h = new int[n];
        boolean ans = true;
        for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        }
        int tmp = h[0];
        for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        }
        System.out.println(ans?"Yes":"No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] h = new int[n]; h new int[n] n boolean ans = true; ans true for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        } int i =0; int i =0; i 0 i<n i n i++ i++ i {
            h[i] = Integer.parseInt(sc.next());
        } {
            h[i] = Integer.parseInt(sc.next());
        } h[i] = Integer.parseInt(sc.next()) h[i] h i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int tmp = h[0]; tmp h[0] h 0 for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        } int i =1; int i =1; i 1 i<n i n i++ i++ i {
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        } {
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        } if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            } tmp<=h[i]-1 tmp h[i]-1 h[i] h i 1 {
                tmp = h[i]-1;
            } tmp = h[i]-1 tmp h[i]-1 h[i] h i 1 if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            } tmp<=h[i] tmp h[i] h i {
                tmp = h[i];
            } tmp = h[i] tmp h[i] h i {
                ans = false;
                break;
            } ans = false ans false break; System.out.println(ans?"Yes":"No") System.out.println System.out System System.out ans?"Yes":"No" ans "Yes" "No" String[] args args
import java.util.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] h = new int[n];
        boolean ans = true;
        for(int i =0;i<n;i++){
            h[i] = Integer.parseInt(sc.next());
        }
        int tmp = h[0];
        for(int i =1;i<n;i++){
            if(tmp<=h[i]-1){
                tmp = h[i]-1;
            } else if(tmp<=h[i]){
                tmp = h[i];
            } else {
                ans = false;
                break;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
}