#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>
#include <list>
#include <cstdlib>
#include <cmath>
#define _USE_MATH_DEFINES

using namespace std;

int main() {

	int n, j = 0;
	double x[4] = { 0 }, y[4] = { 0 };
	double slope1, slope2;
	int ans[100] = { 0 };

	cin >> n;

	while (n) {

		for (int i = 0; i < 4; i++) {
			cin >> x[i] >> y[i];
		}

		slope1 = (y[1] - y[0]) / (x[1] - x[0]);
		slope2 = (y[3] - y[2]) / (x[3] - x[2]);

		if (slope1 == slope2) {
			ans[j] = 1;
		}
		else
			ans[j] = 0;
		n--;
		j++;
	}

	for (int k = 0; k < j; k++) {
		if (ans[k] == 1) {
			cout << "YES" << endl;
		}
		else
			cout << "NO" << endl;
	}

	return 0;
}