#include <bits/stdc++.h>

//const static double	de_PI	= 3.14159265358979323846;
//const static int	de_MOD	= 1000000007;
//const static int	de_MAX	= 999999999;
//const static int	de_MIN = -999999999;

inline double RoundOff(double a, const int n) {

	for (int i = 0; i < n - 1; i++) { a *= 10; }

	if (a > 0) { a += 0.5; }
	else { a -= 0.5; }

	a = static_cast<int>(a);

	for (int i = 0; i < n - 1; i++) { a /= 10; }

	return a;
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	int n = 0;
	std::cin >> n;

	double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
	double slope1 = 0, slope2 = 0;
	std::vector<std::string> ans(n);

	for (int i = 0; i < n; i++) {
		std::cin >> x1 >> y1 >> x2 >> y2;
		slope1 = RoundOff((y2 - y1) / (x2 - x1), 6);
		std::cin >> x1 >> y1 >> x2 >> y2;
		slope2 = RoundOff((y2 - y1) / (x2 - x1), 6);

		if (slope1 == slope2) {
			ans[i] = "YES";
		}
		else {
			ans[i] = "NO";
		}
	}

	for (int i = 0; i < n; i++) {
		std::cout << ans[i] << std::endl;
	}

}