#include <iostream>

int main(){
	double x1,y1,x2,y2,x3,y3,x4,y4;
	int n;
	std::cin >> n;
	for(int i=0 ; i<n ; ++i){
		std::cin >>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
		bool parallel=false;
		if(x1==x2 && x3==x4) {
			parallel=true;
		}
		else if(x1==x2 || x3==x4) {
		}
		else if ((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3)) {
			parallel=true;
		}
		std::cout << ( parallel ? "YES" : "NO") << std::endl;
	}
	return 0; 
}