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

if ary.size == 1
    puts "Yes"
    exit
end

(n-1).times do |i|
    if  ary[i] > ary[i+1] + 1
        break
    elsif ary[i] == ary[i+1] + 1
        ary[i] -= 1
    end
end

puts ary == ary.sort ? "Yes" : "No"
