#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;

		double x1, x2, y1, y2;
		x1 = b.first - a.first;
		y1 = b.second - a.second;
		x2 = d.first - c.first;
		y2 = d.second - c.second;

		if (x1*y2 - x2*y1 == 0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}