var readline = require('readline');
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    terminal: false
});
 
var lines = [];
rl.on('line', function(line) {
    lines.push(line.trim());
}).on('close', function() {
  var entries = parseInt(lines[0]);
  for(var i = 1; i <= entries; i++) {
    var coords = lines[i].split(' ');
    var gradient1 = (parseFloat(coords[0]) - parseFloat(coords[2]))/(parseFloat(coords[1]) - parseFloat(coords[3]));
    var gradient2 = (parseFloat(coords[4]) - parseFloat(coords[6]))/(parseFloat(coords[5]) - parseFloat(coords[7]));
    console.log(gradient1 === gradient2 ? 'YES' : 'NO');
  }
});