#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0;i<(n);i++)
typedef complex<double> xy_t;
double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); }


const double eps = 1e-12;
double x[4], y[4];
int n;

int main() {
	cin >> n;
	rep(t, n) {
		rep(i, 4) cin >> x[i] >> y[i];	
		xy_t a[2] = { xy_t(x[0],y[0]) - xy_t(x[1],y[1]),xy_t(x[2],y[2]) - xy_t(x[3],y[3]) }; //This is how to make an array.
		bool p = abs(cross_product(a[0],a[1])) < eps; //The calculated area is not exactly 0.
		cout << (p ? "YES" : "NO") << endl; //I've seen this kind of expression for the first time...so intuitive.
	}
	return 0;
}
