#include <iostream>
using namespace std;


class vec{
public:
	double x;
	double y;

	vec(){}
	vec(double x1, double y1, double x2, double y2) : x(x2 - x1), y(y2 - y1){}

	double sarrus(const vec v){
		return x*v.y - y*v.x;
	}
};


int main(){
	int n;
	double x1, y1, x2, y2;
	vec v1, v2;
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> x1 >> y1 >> x2 >> y2;
		v1 = vec(x1, y1, x2, y2);
		cin >> x1 >> y1 >> x2 >> y2;
		v2 = vec(x1, y1, x2, y2);

		if(v1.sarrus(v2) == 0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}