#include<iostream>
#include<vector>
struct Coordinate {
	double x;
	double y;
};
std::vector<bool>l;
int main() {
	Coordinate A, B, C, D;
	double Inclination_of_AB;
	double Inclination_of_CD;
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++){
		std::cin >> A.x >> A.y >> B.x >> B.y;
		Inclination_of_AB = (B.x - A.x) / (B.y - A.y);
		std::cin >> C.x >> C.y >> D.x >> D.y;
		Inclination_of_CD = (D.x - C.x) / (D.y - C.y);
		if (Inclination_of_AB == Inclination_of_CD)
			l.push_back(true);
		else l.push_back(false);
	}
	for (bool i : l) {
		if (i)std::cout << "YES";
		else std::cout << "NO";
		std::cout << std::endl;
	}
	char c;
	std::cin >> c;
}