#include <iostream>

int main()
{
	int n;
	std::cin >> n;
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double at_x_zero_ab, at_x_zero_cd;
	double slope_ab, slope_cd;
	for (int i = 0; i < n; i++) {
		std::cin >> x1 >> y1 >> x2 >> y2
                 >> x3 >> y3 >> x4 >> y4;
		slope_ab = (y2 - y1) / (x2 - x1);
		slope_cd = (y4 - y3) / (x4 - x3);
		at_x_zero_ab = y1 - slope_ab * x1;
		at_x_zero_cd = y3 - slope_cd * x3;
		if (slope_ab == slope_cd && at_x_zero_ab != at_x_zero_cd) {
			std::cout << "YES\n";
		} else {
			std::cout << "NO\n";
		}
	}
	return 0;
}