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

void main(){

    real[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!real(s[2*i]);
	    y[i] = to!real(s[2*i+1]);
	}
	real[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 || CD[0] == 0){
	    if(AB[0] == CD[0]) flg = true;
	}else if( AB[1]*CD[0] - CD[1]*AB[0] == 0) flg = true;

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