#include<iostream>
using namespace std;

int main()
{
	int n;
	cin >> n;
	double a[100][4][2];
	for (int i = 0;i < n;i++)
		for (int j = 0;j < 4;j++)
			cin >> a[i][j][0] >> a[i][j][1];
	for (int k = 0;k < n;k++) {
		if (a[k][0][0] - a[k][1][0] == 0 && a[k][2][0] - a[k][3][0])
			cout << "YES" << endl;
		else {
			if ((a[k][2][0] - a[k][3][0])*(a[k][0][1] - a[k][1][1]) == (a[k][0][0] - a[k][1][0])*(a[k][2][1] - a[k][3][1]))
				cout << "YES" << endl;
			else
				cout << "NO" << endl;
		}
	}
    return 0;
}
