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


int main(){
	int n;
	pair <double, double> a, b, c, d;

	cin >> n;

	for (int i = 0; i < n; i++){
		cin >> a.first >> a.second;
		cin >> b.first >> b.second;
		cin >> c.first >> c.second;
		cin >> d.first >> d.second;

		pair <double, double> v, u;
		v = { b.first - a.first, b.second - a.second };
		u = { d.first - c.first, d.second - c.second };

		if (abs(atan2(v.second, v.first) - atan2(u.second, u.first)) < 0.00000000001)
			cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}