#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
using namespace std;
int main() {
	double x1, x2, x3, x4, y1, y2, y3, y4;
	int n;
	cin >> n;
	for (int z = 0; z < n; z++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		double a = 9090909, b = 9090909;
		if(y1!=y2)a = (x1 - x2) / (y1 - y2);
		if(y3!=y4)b = (x3 - x4) / (y3 - y4);
		if (a == b) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	cin >> n;
}