local n=io.read("n")
local previous=io.read("n")-1
local flag=true
for i=2,n do
    local now=io.read("n")
    if previous<now then
        previous=now-1
    elseif previous>now then
        flag=false
    end
end
print(flag and "Yes" or "No")