#include <iostream>

const int NUM = 8;

bool isParallel(const double* point);

int main()
{
	int n;
	std::cin >> n;

	double point[n][NUM];
	bool isParallelArray[n];

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < NUM; j++) {
			std::cin >> point[i][j];
		}
	}
	for (int i = 0; i < n; i++) {
		if ( isParallel(point[i]) ) {
			std::cout << "YES" << std::endl;
		} else {
			std::cout << "NO" << std::endl;
		}
	}
}

bool isParallel(const double* point) {
	return (point[3] - point[1]) / (point[2] - point[0]) == (point[7] - point[5]) / (point[6] - point[4]);
}