#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 201
#define _MAX 100
#define ABC 26
int main(void)
{
	int n, ans[_MAX] = { 0 };
	double x1, y1, x2, y2, x3, y3, x4, y4, a1, b1, a2, b2;
	scanf_s("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		a1 = (y1 - y2) / (x1 - x2);
		b1 = y1 - (x1 * a1);
		a2 = (y3 - y4) / (x3 - x4);
		b2 = y3 - (x3 * a2);
		if (a1 == a2 && b1 != b2)
			++ans[i];
	}
	for (int i = 0; i < n; ++i) {
		if (ans[i])
			printf("YES");
		else
			printf("NO");
	}
}