#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, c, d;

int x;
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 = x_2 - x_1;
		b = y_2 - y_1;
		c = x_4 - x_3;
		d = y_4 - y_3;
		if(a * d == b * c){
			cout << "YES\n";
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}