N = gets.chomp.to_i
str = gets.split
a = Array.new(N)
for i in 0...N do
    a[i] = str[i].to_i
end
a.reverse!
for i in 1...N do
    if a[i]-1 > a[i-1]
        puts "No"
        exit
    elsif a[i]-1 == a[i-1]
        a[i] -= 1
    end
end
puts "Yes"