import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    // input N H1 H2 ... HN
        Scanner sc = new Scanner(System.in);
        int numNum = sc.nextInt();
        int tempNum = 0;
        int tempMax = sc.nextInt();
        String result = "Yes";
        for(int i = 1; i < numNum; i++){
            tempNum = sc.nextInt();
            if(tempNum < tempMax - 1){
                result = "No";
                break;
            } else if(tempMax < tempNum){
                tempMax = tempNum;
            }
        }
        System.out.println(result);
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz