#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int main(){
	int n;
	
	cin >> n;
	
	while (n--){
		double x1, x2, x3, x4;
		double y1, y2, y3, y4;
		
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		
		double dx12, dy12, dx34, dy34;
		double a12, a34;
		
		if (x1 < x2){
			dx12 = x2 - x1;
			dy12 = y2 - y1;
		}
		else {
			dx12 = x1 - x2;
			dy12 = y1 - y2;
		}
		
		if (x3 < x4){
			dx34 = x4 - x3;
			dy34 = y4 - y3;
		}
		else {
			dx34 = x3 - x4;
			dy34 = y3 - y4;
		}
		
		a12 = dy12/dx12;
		a34 = dy34/dx34;
		
		if (a12 == a34) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}