#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int k;
	double x1,x2,x3,x4,y1,y2,y3,y4;
	double veku1[2];
	double veku2[2];
	double veku3[2];
	double t;
	double m;
	cin >> k;

	for (int i = 0; i < k; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		veku1[0] = x2 - x1;
		veku1[1] = y2 - y1;
		veku2[0] = x4 - x3;
		veku2[1] = y4 - y3;
		if (veku1[0] == 0) {
			if (veku2[0] != 0) {
				cout << "NO" << endl;
			} else {
				cout << "YES" << endl;
			}
		} else if (veku1[1] == 0){
			if (veku2[1] != 0) {
				cout << "NO" << endl;
			} else {
				cout << "YES" << endl;
			}
		} else {
			if ((veku2[0] / veku1[0]) == (veku2[1] / veku1[1])) {
				cout << "YES" << endl;
			} else {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}