import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	} main {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<Integer> list=new ArrayList<Integer>(); list new ArrayList<Integer>() for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		} int i=0; int i=0; i 0 n>i n i i++ i++ i {
			int a = sc.nextInt();
			list.add(a);
		} {
			int a = sc.nextInt();
			list.add(a);
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc list.add(a) list.add list a list.set(0, list.get(0)-1) list.set list 0 list.get(0)-1 list.get(0) list.get list 0 1 for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		} int i=0; int i=0; i 0 list.size()-1>i list.size()-1 list.size() list.size list 1 i i++ i++ i {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		} {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		} int a = list.get(i); a list.get(i) list.get list i int b = list.get(i+1); b list.get(i+1) list.get list i+1 i 1 if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			} a<b a b list.set(i+1, b-1) list.set list i+1 i 1 b-1 b 1 if(a>b) {
				System.out.println("No");
				System.exit(0);
			} a>b a b {
				System.out.println("No");
				System.exit(0);
			} System.out.println("No") System.out.println System.out System System.out "No" System.exit(0) System.exit System 0 System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			list.add(a);
		}
		list.set(0, list.get(0)-1);
		for(int i=0;list.size()-1>i;i++) {
			int a = list.get(i);
			int b = list.get(i+1);
			if(a<b)
				list.set(i+1, b-1);
			else if(a>b) {
				System.out.println("No");
				System.exit(0);
			}
		}
		System.out.println("Yes");
	}
}