#include <iostream>

const int NUM = 8;

bool isParallel(const double* point);

int main()
{
	int n;
	double point[NUM];
	std::cin >> n;
	while (n-- > 0) {
		for (int i = 0; i < NUM; i++) {
			std::cin >> point[i];
		}
		if ( isParallel(point) ) {
			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]);
}