#include <iostream>
#include <cmath>
using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	double x[4];
	double y[4];

	while(n > 0){
		for(int i = 0; i < 4; ++i){
			cin >> x[i] >> y[i];
		}

		double m1 = (y[1] - y[0]) / (x[1] - x[0]);
		double m2 = (y[3] - y[2]) / (x[3] - x[2]);

		cout << (m1 == m2 ? "YES" : "NO") << endl;

		--n;
	}

	return 0;
}