N = gets.to_i
S = gets.split.map(&:to_i).sort

# p [N, S]

queue = []
origin = S.pop
queue << [origin, 0]

until queue.empty?
  parent, gene = queue.shift

  idx = S.bsearch_index { |s| s >= parent } || 0
  # p [:parent, parent, :gene, gene, :idx, idx, S[-10..-1]]

  child = S[idx - 1]
  S.delete_at(idx - 1)

  if parent <= child
    puts 'No'
    exit
  end

  if gene + 1 < N
    queue << [parent, gene + 1]
    queue << [child, gene + 1]
  end
end

puts 'Yes'
