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

double cross (cdouble a, cdouble b) {
	return (a * b.conj).im;
}

void main()
{
	int n = readln.chomp.to!int;
	foreach (i; 0..n) {
		auto p = readln.split.map!(to!double);
		auto a = p[2] - p[0] + (p[3] - p[1]) * 1i;
		auto b = p[6] - p[4] + (p[7] - p[5]) * 1i;
		if (cross(a, -b).abs < 1e-12) writeln("YES");
		else writeln("NO");
	}
}