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