N = gets.chomp.to_i
s = gets.chomp.split.map(&:to_i)

# p N
S = s.sort.reverse

invalid = false

i = 2
while (i <= 2**N) do
  # left = 0
  # right = i - 1
  counts = {}
  0.upto(i-1).each do |j|
    counts[S[j]] ||= 0
    counts[S[j]] += 1
    if counts[S[j]] > i / 2
      invalid = true
      break
    end
  end
  break if invalid
  i *= 2
end
  
if invalid
  print "No\n"
else
  print "Yes\n"
end