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

if n == 1
    puts "Yes"
    return
end

can = true

(1..n-1).each do |i|
    if h[i] < h[i-1]
        can = false
        # break
    elsif h[i] > h[i-1]
        h[i] -= 1
    end
end

puts "Yes" if can
puts "No" if !can