import java.awt.*;
import java.io.*;
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	}
	class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	}
	class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	}
	class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	}
} import java.awt.*; awt.* java import java.io.*; io.* java import java.util.*; util.* java public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	}
	class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	}
	class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	}
	class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	}
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args){
		new Main();
	} main {
		new Main();
	} new Main() String[] args args public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	} Main {
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	} new TestC().doIt() new TestC().doIt new TestC() class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	} TestE void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		} doIt {
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int A[] = new int[N]; A new int[N] N for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				A[i] = sc.nextInt();
			} {
				A[i] = sc.nextInt();
			} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc System.out.println(maxGCD(N,K,A)) System.out.println System.out System System.out maxGCD(N,K,A) maxGCD N K A int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		} maxGCD {
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		} int result = 0; result 0 for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			} int i = 1; int i = 1; i 1 i < 100 i 100 i++ i++ i {
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			} {
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			} int sum = 0; sum 0 for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				} int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				} {
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				} if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					} (A[j] % i) < i/2 (A[j] % i) A[j] A j i i/2 i 2 {
						sum = sum + A[j] % i;
					} sum = sum + A[j] % i sum sum + A[j] % i sum A[j] % i A[j] A j i {
						sum = sum - i + (A[j] % i);
					} sum = sum - i + (A[j] % i) sum sum - i + (A[j] % i) sum - i sum i (A[j] % i) A[j] A j i System.out.println(i+" "+sum) System.out.println System.out System System.out i+" "+sum i+" "+sum i " " sum return 0; 0 int N N int K K int A[] A class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	} TestD void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		} doIt {
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		} String S = sc.next(); S sc.next() sc.next sc int length = S.length(); length S.length() S.length S char setRL[] = S.toCharArray(); setRL S.toCharArray() S.toCharArray S int children[][] = new int[2][length]; children new int[2][length] 2 length int copyChildren[] = new int[length]; copyChildren new int[length] length for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			} int x = 0; int x = 0; x 0 x < length x length x++ x++ x {
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			} {
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			} children[0][x] = 1 children[0][x] children[0] children 0 x 1 copyChildren[x] = children[0][x] copyChildren[x] copyChildren x children[0][x] children[0] children 0 x moveChildren(setRL,children,copyChildren,length) moveChildren setRL children copyChildren length for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			} int x = 0; int x = 0; x 0 x < length-1 x length-1 length 1 x++ x++ x {
				System.out.print(copyChildren[x]+" ");
			} {
				System.out.print(copyChildren[x]+" ");
			} System.out.print(copyChildren[x]+" ") System.out.print System.out System System.out copyChildren[x]+" " copyChildren[x] copyChildren x " " System.out.println(copyChildren[length - 1]) System.out.println System.out System System.out copyChildren[length - 1] copyChildren length - 1 length 1 void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		} moveChildren {
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		} while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			} true {
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			} boolean isTheSameSet = true; isTheSameSet true for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				} int y = 0; int y = 0; y 0 y < 2 y 2 y++ y++ y {
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				} {
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				} for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					} int x = 0; int x = 0; x 0 x < length x length x++ x++ x {
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					} {
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					} if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						} RLSet[x] == 'R' RLSet[x] RLSet x 'R' {
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						} children[(y+1)%2][x+1] += children[y%2][x] children[(y+1)%2][x+1] children[(y+1)%2] children (y+1)%2 (y+1) y 1 2 x+1 x 1 children[y%2][x] children[y%2] children y%2 y 2 x children[y%2][x] = 0 children[y%2][x] children[y%2] children y%2 y 2 x 0 {
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						} children[(y+1)%2][x-1] += children[y%2][x] children[(y+1)%2][x-1] children[(y+1)%2] children (y+1)%2 (y+1) y 1 2 x-1 x 1 children[y%2][x] children[y%2] children y%2 y 2 x children[y%2][x] = 0 children[y%2][x] children[y%2] children y%2 y 2 x 0 for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				} int x = 0; int x = 0; x 0 x < length x length x++ x++ x {
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				} {
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				} if(children[0][x] != copyChildren[x])isTheSameSet = false; children[0][x] != copyChildren[x] children[0][x] children[0] children 0 x copyChildren[x] copyChildren x isTheSameSet = false isTheSameSet false copyChildren[x] = children[0][x] copyChildren[x] copyChildren x children[0][x] children[0] children 0 x if(isTheSameSet)break; isTheSameSet break; char RLSet[] RLSet int children[][] children int copyChildren[] copyChildren int length length class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	} TestC void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		} doIt {
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		} int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int H[] = new int[N]; H new int[N] N 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 boolean result = canMonotonousDecrease(N,H); result canMonotonousDecrease(N,H) canMonotonousDecrease N H if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			} result {
				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" boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		} canMonotonousDecrease {
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		} for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			} {
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			} int diff = H[i] - H[i-1]; diff H[i] - H[i-1] H[i] H i H[i-1] H i-1 i 1 if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false; diff > 0 diff 0 H[i] = H[i] - 1 H[i] H i H[i] - 1 H[i] H i 1 if(diff < 0)return false; diff < 0 diff 0 return false; false return true; true int N N int H[] H public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	}
	class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	}
	class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	}
	class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	}
} public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	}
	class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	}
	class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	}
	class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	}
} Main
import java.awt.*;
import java.io.*;
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new TestC().doIt();
//		new TestD().doIt();
//		new TestE().doIt();
	}
	class TestE{
		void doIt(){
			int N = sc.nextInt();
			int K = sc.nextInt();
			int A[] = new int[N];
			for(int i = 0;i < N;i++){
				A[i] = sc.nextInt();
			}
			System.out.println(maxGCD(N,K,A));
		}
		int maxGCD(int N,int K,int A[]){
			int result = 0;
			for(int i = 1;i < 100;i++){
				int sum = 0;
				for(int j = 0;j < N;j++){
					if((A[j] % i) < i/2){
						sum = sum + A[j] % i;
					}else{
						sum = sum - i + (A[j] % i);
					}
				}
				System.out.println(i+" "+sum);
			}
			return 0;
		}
	}
	class TestD{
		void doIt(){
			String S = sc.next();
			int length = S.length();
			char setRL[] = S.toCharArray();
			int children[][] = new int[2][length];
			int copyChildren[] = new int[length];
			for(int x = 0;x < length;x++){
				children[0][x] = 1;
				copyChildren[x] = children[0][x];
			}
			moveChildren(setRL,children,copyChildren,length);
			for(int x = 0;x < length-1;x++){
				System.out.print(copyChildren[x]+" ");
			}
			System.out.println(copyChildren[length - 1]);
		}
		void moveChildren(char RLSet[],int children[][],int copyChildren[],int length){
			while(true){
				boolean isTheSameSet = true;
				for(int y = 0;y < 2;y++){
					for(int x = 0;x < length;x++){
						if(RLSet[x] == 'R'){
							children[(y+1)%2][x+1] += children[y%2][x];
							children[y%2][x] = 0;
						}
						else{
							children[(y+1)%2][x-1] += children[y%2][x];
							children[y%2][x] = 0;
						}
					}
				}
				for(int x = 0;x < length;x++){
					if(children[0][x] != copyChildren[x])isTheSameSet = false;
					copyChildren[x] = children[0][x];
				}
				if(isTheSameSet)break;
			}
		}
	}
	class TestC{
		void doIt(){
			int N = sc.nextInt();
			int H[] = new int[N];
			for(int i = 0;i < N;i++){
				H[i] = Integer.parseInt(sc.next());
			}
			boolean result = canMonotonousDecrease(N,H);
			if(result){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
 		}
		boolean canMonotonousDecrease(int N,int H[]){
			for(int i = 1;i < N;i++){
				int diff = H[i] - H[i-1];
				if(diff > 0)H[i] = H[i] - 1;
				else if(diff < 0)return false;
			}
			return true;
		}
	}
}