line = []

while line << gets.chomp
  if line.size == line[0].to_i + 1
    break
  end
end

len = line.size - 1
i = 1

while i <= len
  a = line[i].split
  i += 1
  if a.size - a.uniq.size == 1
    puts "YES"
  else
    puts "NO"
  end
end