#include <iostream>
using namespace std;
int main(){
	int n;
	double x1,y1,x2,y2,x3,y3,x4,y4;
	double vx1, vy1, vx2, vy2;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		vx1 = x2 - x1;
		vy1 = y2 - y1;
		vx2 = x4 - x3;
		vy2 = y4 - y3;
		if ((vx1 != 0 && vy1 != 0) || (vx2 != 0 && vy2 != 0)){
			if (vy1*vx2 == vx1*vy2) cout << "YES\n";
			else cout << "NO\n";
		}
		else cout << "NO\n";
	}
}