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

def check(slimes)
  n = slimes.size

  return true if n == 1

  mid = n / 2

  (n / 2).times do |i|
    return false if slimes[i] >= slimes[i + mid]
  end

  check(slimes[mid..-1])
end

if check(S)
  puts 'Yes'
else
  puts 'No'
end
