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

if n == 1
    puts "Yes"
    return
end

can = true

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

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