var fs = require('fs'),
length = fs.fstatSync(process.stdin.fd).size,
buffer = new Buffer(length),
bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();

function main(){
  for(var i = 1, len = input[0]-0; i <= len; i++){
    var c = input[i].split(' ');
    var x1 = c[0];
    var y1 = c[1];
    var x2 = c[2];
    var y2 = c[3];
    var x3 = c[4];
    var y3 = c[5];
    var x4 = c[6];
    var y4 = c[7];
    
    console.log(((x2-x1)/(y2-y1)).toFixed(5) == ((x4-x3)/(y4-y3)).toFixed(5) ? 'YES' : 'NO');
  }
}