import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter pw) {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	}
}
class Pair<A,B>{
	A first;
	B second;
	Pair(A first,B second){
		this.first=first;
		this.second=second;
	}
}


class InputReader{
    BufferedReader br;
    StringTokenizer st;
    public InputReader(InputStream in){
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    }
    public String next(){
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    }
    public int nextInt(){
        return Integer.parseInt(next());
    }
    public long nextLong() {
    	return Long.parseLong(next());
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.BufferedWriter; BufferedWriter java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.io.PrintWriter; PrintWriter java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
} Main public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	} main {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	} InputReader in = new InputReader(System.in); in new InputReader(System.in) PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true); out new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true) TaskB solver = new TaskB(); solver new TaskB() solver.solve(1, in, out) solver.solve solver 1 in out out.flush() out.flush out out.close() out.close out String[] args args class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter pw) {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	}
} TaskB public void solve(int testNumber, InputReader in, PrintWriter pw) {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	} solve {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	} int n=in.nextInt(); n in.nextInt() in.nextInt in int arr[]=new int[n]; arr new int[n] n for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
    		arr[i]=in.nextInt();
    	} {
    		arr[i]=in.nextInt();
    	} arr[i]=in.nextInt() arr[i] arr i in.nextInt() in.nextInt in boolean flag=true; flag true int temp=arr[0]; temp arr[0] arr 0 int max=arr[0]; max arr[0] arr 0 for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	} int i=1; int i=1; i 1 i<n i n i++ i++ i {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	} {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	} if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		} arr[i]<temp-1||arr[i]<max arr[i]<temp-1 arr[i] arr i temp-1 temp 1 arr[i]<max arr[i] arr i max {
    			flag=false;
    			break;
    		} flag=false flag false break; max=temp-1>max?temp-1:max max temp-1>max?temp-1:max temp-1>max temp-1 temp 1 max temp-1 temp 1 max temp=arr[i] temp arr[i] arr i if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	} flag {
    		pw.println("Yes");
    	} pw.println("Yes") pw.println pw "Yes" {
    		pw.println("No");
    	} pw.println("No") pw.println pw "No" int testNumber testNumber InputReader in in PrintWriter pw pw class Pair<A,B>{
	A first;
	B second;
	Pair(A first,B second){
		this.first=first;
		this.second=second;
	}
} Pair A first; first B second; second Pair(A first,B second){
		this.first=first;
		this.second=second;
	} Pair {
		this.first=first;
		this.second=second;
	} this.first=first this.first this this.first first this.second=second this.second this this.second second A first first B second second class InputReader{
    BufferedReader br;
    StringTokenizer st;
    public InputReader(InputStream in){
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    }
    public String next(){
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    }
    public int nextInt(){
        return Integer.parseInt(next());
    }
    public long nextLong() {
    	return Long.parseLong(next());
    }
} InputReader BufferedReader br; br StringTokenizer st; st public InputReader(InputStream in){
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    } InputReader {
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    } br=new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) st=null st null InputStream in in public String next(){
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    } next {
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    } while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    } st==null||!st.hasMoreTokens() st==null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    } try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        } catch(IOException e){
            throw new RuntimeException(e);
        } IOException e {
            throw new RuntimeException(e);
        } throw new RuntimeException(e); new RuntimeException(e) {
            st=new StringTokenizer(br.readLine());
        } st=new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt(){
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {
    	return Long.parseLong(next());
    } nextLong {
    	return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
} public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
} Main
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.flush();
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter pw) {
    	int n=in.nextInt();
    	int arr[]=new int[n];
    	for(int i=0;i<n;i++) {
    		arr[i]=in.nextInt();
    	}
    	boolean flag=true;
    	int temp=arr[0];
    	int max=arr[0];
    	for(int i=1;i<n;i++) {
    		if(arr[i]<temp-1||arr[i]<max) {
    			flag=false;
    			break;
    		}
    		max=temp-1>max?temp-1:max;
    		temp=arr[i];
    	}
    	if(flag) {
    		pw.println("Yes");
    	}else {
    		pw.println("No");
    	}
    	
    		
    	}
}
class Pair<A,B>{
	A first;
	B second;
	Pair(A first,B second){
		this.first=first;
		this.second=second;
	}
}


class InputReader{
    BufferedReader br;
    StringTokenizer st;
    public InputReader(InputStream in){
        br=new BufferedReader(new InputStreamReader(in));
        st=null;
    }
    public String next(){
    while(st==null||!st.hasMoreTokens()){
        try{
            st=new StringTokenizer(br.readLine());
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
   return st.nextToken();
    }
    public int nextInt(){
        return Integer.parseInt(next());
    }
    public long nextLong() {
    	return Long.parseLong(next());
    }
}
