#include <cstdio>
using namespace std;

int main(){
	int t;
	__int64 x1, y1, x2, y2, x3, y3, x4, y4;
	double s1, s2, s3, s4, s5, s6, s7, s8;
	scanf("%d", &t);
	while(t--){
		scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &s1, &s2, &s3, &s4, &s5, &s6, &s7, &s8);
		x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000;
		y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000;
		printf("%s\n", ((x2 - x1) * (y4 - y3) == (x4 - x3) * (y2 - y1))? "YES" : "NO");
	}
	return 0;
}