import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   }
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   }
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   } main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		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 int prev = sc.nextInt() - 1; prev sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		} {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		} int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc if (prev < x) {
		        x--;
		    } prev < x prev x {
		        x--;
		    } x-- x if (prev > x) {
		        System.out.println("No");
		        return;
		    } prev > x prev x {
		        System.out.println("No");
		        return;
		    } System.out.println("No") System.out.println System.out System System.out "No" return; prev = x prev x 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);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   }
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   }
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int prev = sc.nextInt() - 1;
		for (int i = 1; i < n; i++) {
		    int x = sc.nextInt();
		    if (prev < x) {
		        x--;
		    }
		    if (prev > x) {
		        System.out.println("No");
		        return;
		    }
		    prev = x;
		}
		System.out.println("Yes");
   }
}
