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

void main()
{
	int n = readln.chomp.to!int;
	foreach (i; 0..n) {
		auto p = readln.split.map!(to!double);
		(((p[0]-p[2])*(p[5]-p[7])-(p[1]-p[3])*(p[4]-p[6])).fabs < 1e-5?"YES":"NO").writeln;
	}
}