require 'pp'
require 'set'

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

ok = true
xx = false
h_n.each_cons(2) do |x, y|
    if y - x == -1
        if xx == true
            ok = false
            break
        end
        xx = true
    elsif y - x < -1
        ok = false
        break
    else
        xx = false
    end
end

if ok
    puts "Yes"
else
    puts "No"
end



