#include <bits/stdc++.h>
#include <vector>
using namespace std;
double x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, a, b, x;
double gradien(double x_1, double y_1, double x_2, double_y2){
	double m = 0;
	m = (y_1 - y_2)/(x_1 - x_2);
	
	return m;
}
int main(){
	cin >> x;
	for(int i = 1; i <= x; i++){
		cin >> x_1 >> y_1 >> x_2 >> y_2 >> x_3 >> y_3 >> x_4 >> y_4;
		a = gradien(x_1, y_1, x_2, y_2);
		b = gradien(x_3, y_3, x_4, y_4);
		if(a == b){
			cout << "YES\n";
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}