n = gets.to_i
s = gets.split.map(&:to_i)
s.sort!
n.times do |i|
  a = s[0..(s.size/2 - 1)]
  b = s[(s.size/2)..-1]
  if a.count(b[0]) > b.size - b.count(b[0])
    puts 'No'
    exit
  end
  s = s[(s.size/2)..-1]
end
puts 'Yes'
