n=io.read("*n","*l")
h={}
for i=1,n do
    h[i]=io.read("*n")
end
previous=h[1]-1
for i=2,n do
    if previous<h[i] then
        previous=h[i]-1
    elseif previous>h[i] then
        print("No")
        return
    end
end
print("Yes")