import std.stdio;
import std.string;
import std.math;
import std.conv;
import std.algorithm;
import std.bigint;

void main(){

    double[4] x,y;
    auto n = to!int(chomp(readln()));
    for(int j=0;j<n;j++){
	auto s = split(readln());
	for(int i=0;i<4;i++){
	    x[i] = to!double(s[2*i]);
	    y[i] = to!double(s[2*i+1]);
	}
	double[2] AB,CD;
	bool flg = false;
	AB[0] = x[1] - x[0];
	AB[1] = y[1] - y[0];
	CD[0] = x[3] - x[2];
	CD[1] = y[3] - y[2];

	if(AB[0] == 0 ){
	    if (CD[0] == 0) flg = true;
	}
	else if( abs( (AB[1]*CD[0] - CD[1]*AB[0])/(AB[0]*CD[0]) )<= 1e-6) flg = true;

	if(flg) writeln("YES");
	else writeln("NO");
    }
}