gets
h = gets.split.map(&:to_i).reverse
pre = h.shift

until h.empty? do
    if (x = h.shift) > pre + 1 then
        puts "No"
        exit
    elsif x != pre + 1
        pre = x
    end
end

puts "Yes"