#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
	double a[8];
	int n;
	cin >> n;
	while (n--) {
		for (int i = 0; i < 8; i++) cin >> a[i];
		int dx1 = (a[0] - a[2]) / (a[1] - a[3]);
		int dx2 = (a[4] - a[6]) / (a[5] - a[7]);
		if (dx1 == dx2) printf("YES\n");
		else printf("NO");
	}
	return 0;
}