lines = STDIN.read.chomp.split("\n")
lines.shift.to_i.times do |i|
  elems = lines[i].split.sort.reverse;
  result = elems[0].to_i**2 == elems[1..-1].map { |j| j.to_i**2 }.inject(:+) ? 'YES' : 'NO';
  puts result
end