var N = -1, current = 0;
var readline = require('readline');
var rl = readline.createInterface({
  input:process.stdin,
  output: process.stdout,
  terminal: false
});
rl.on('line', function(line){
  if (N === -1) {
    N = parseInt(line);
  } else {
    current++;
    var components = line.split(' ');
    var a = parseInt(components[0]), b = parseInt(components[1]),
        c = parseInt(components[2]);
    console.log(a * a + b * b === c * c ? 'YES' : 'NO');
    if (current >= N) process.exit();
  }
});