import std.stdio,std.string,std.conv;
void main(){
	auto n = to!int(readln().chomp());
	for( int i=0; i<n ; i++ ){
		auto arr = readln().chomp().split();
		double[] arr2;
		arr2.length = arr.length;
		for( int j=0; j<arr.length ; j++ ){
			arr2[j] = to!double( arr[j] );
		}
		if( (arr2[3]-arr2[1])/(arr2[2]-arr2[0]) == (arr2[7]-arr2[5])/(arr2[6]-arr2[4]) ){
			writeln("YES");
		}else{
			writeln("NO");
		}
	}
}