n = gets.chomp.to_i
h = gets.split.map(&:to_i)
for i in 0..(n-2)
    if h[n-i-2] <= h[n-i-1]
    elsif h[n-i-2] > h[n-i-1] && h[n-i-2]-1 == h[n-i-1]
        h[n-i-2] -= 1
    else
        puts "No"
        exit
    end
end
puts "Yes"