#!/usr/local/gnu/bin/bash
read n
read -a h
for i in `seq $((n-1)) -1 1`
do
    if((h[i-1]-h[i]>1))
    then
        echo No
        exit
    elif((h[i-1]-h[i]==1))
    then
        h[$((i-1))]=$((h[i-1]-1))
    fi
done
echo Yes