n = gets.to_i
h = gets.chomp.split.reverse
n.times do |i|
    h[i] = h[i].to_i
end

result = true
(n-1).times do |i|
    if h[i] - 1 > h[0]
        result = false
        break
    end
end

puts result ? "Yes" : "No"