var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
Arr.shift();
Arr.forEach(function(v){
var arr=v.split(" ").map(Number);
arr=arr.map(function(v){return v+100;});
var ab=(arr[3]-arr[1])/(arr[2]-arr[0]);
var cd=(arr[3+4]-arr[1+4])/(arr[2+4]-arr[0+4]);
var ad=(arr[3+4]-arr[1])/(arr[2+4]-arr[0]);
var x=(ab==cd && ab!=ad)?"YES":"NO";
console.log(x);
});