#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <iostream>


using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		double x[4], y[4];
		for (int j = 0; j < 4; ++j)
			scanf("%lf %lf", x+j, y+j);
		if (abs(atan((y[1]-y[0])/(x[1]-x[0])) - atan((y[3]-y[2])/(x[3]-x[2]))) < 3.14/1000)
			puts("YES");
		else
			puts("NO");
	}

	return 0;
}