n=io.read("*n")
h={}
for i=1,n do
    h[i]=io.read("*n")
end

for i=1,n-1 do
    if h[i+1]-h[i]<=-2 then
        print("No")
        return
    end 
end
for i=1,n-1 do
    if h[i+1]-h[i]==-1 then
        h[i]=h[i]-1
    end
end
for i=1,n-1 do
    if h[i+1]-h[i]<0 then
        print("No")
        return
    end 
end
print("Yes")