local N = io.read("n")
local H = {}
for i=1, N do
    H[i] = io.read("n")
end
local left = H[1] - 1
for i=2, N do
    if H[i] > left then
        left = H[i] - 1
    elseif H[i] == left then
        left = H[i]
    else
        print("No")
        return
    end
end
print("Yes")