#include <cstdio>
#include <cmath>

int n;

int main(){
	scanf("%d", &n);
	for(int i = 0; i < n; ++i){
		double x[4][2];
		for(int j = 0; j < 4; ++j){
			scanf("%lf%lf", x[j], x[j] + 1);
		}
		double y[2][2] = {
			{x[0][0] - x[1][0], x[0][1] - x[1][1]},
			{x[2][0] - x[3][0], x[2][1] - x[3][1]}
		};

		//printf("%lf\n", y[0][0] * y[1][1] - y[0][1] * y[1][0]);

		if(std::abs(y[0][0] * y[1][1] - y[0][1] * y[1][0]) < 0.001){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}