n = gets.chomp.to_i
h = gets.split.map(&:to_i)

for i in 0..(n-2)
    if h[i] > h[i+1]
        h[i] -= 1
        if h[i] > h[i+1] || h[i-1] > h[i]
            puts "No"
            exit
        end
    end
end
puts "Yes"