n = gets.to_i
s = gets.split.map(&:to_i)

# p n
s.sort!
# p s

n.times do |i|
  # puts "\n1回目"
  a = s[0..(s.size/2 - 1)]
  b = s[(s.size/2)..-1]
  # p a
  # p b
  unless a.count(b[0]) < b.count(b[0])
    puts 'No'
    exit
  end
  s = s[(s.size/2)..-1]
end
puts 'Yes'
