line = []
sum = 0

while line = gets
  line.chomp!

  if line.size == 1
    num = line.to_i
    next
  end

  a = line.split
  a.sort!
  
  if a[-1].to_i ** 2 == (a[-2].to_i ** 2) + (a[-3].to_i ** 2)
    puts "YES"
    sum += 1
    if sum == num
      break
    end
  else
    puts "NO"
    sum += 1
    if sum == num
      break
    end
  end
end