lines = STDIN.readlines.map(&:chomp)
num_of_elems = lines.shift.to_i
num_of_elems.times { |i| elems = lines[i].split.sort.reverse; puts (elems[0].to_i**2 == elems[1..-1].map { |j| j.to_i**2 }.inject(:+) ? 'YES' : 'NO'); }