#include<iostream>
using namespace std;

int main()
{
	int n;
	double p[4][2];
	
	cin >> n;

	for (int x = 0; x < n; ++x){
		for (int i = 0; i < 4; ++i){
			for (int j = 0; j < 2; ++j){
				cin >> p[i][j];
			}
		}

		if ((p[0][0] - p[1][0]) / (p[0][1] - p[1][1]) == (p[2][0] - p[3][0]) / (p[2][1] - p[3][1]))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}