#include<bits/stdc++.h>
using namespace std;

int main(){
    unsigned long N, H;
    cin >> N >> H;
    for(unsigned long i = 1, h; i < N; ++i){
        cin >> h;
        if(H > h)return 0 & puts("No");
        if(H < h)--h;
        swap(H, h);
    }
    puts("Yes");
}