n = gets.chomp.to_i

h = gets.chomp.split.map(&:to_i)

(0...2**n).each do |bit|
  res = h.dup
  (0...n).each do |i|
    if bit[i] > 0
      # 減らす
      res[i] -= 1
    else
      # 何もしない
    end
  end
  success = true
  before = - 1
  res.each do |a|
    if a < before
      success = false
      break
    end
    before = a
  end
  if success
    puts "Yes"
    exit
  end
end
puts "No"
