#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int l = 0; l < n; l++) {
		double x[4], y[4],v[2];
		for (int i = 0; i < 4; i++)cin >> x[i] >> y[i];
		v[0]=(y[1] - y[0]) / (x[1] - x[0]);
		v[1]=(y[3] - y[2]) / (x[3] - x[2]);
		if (x[0] == x[1] && x[2] == x[3]) {
			cout << "YES" << endl;
			continue;
		} else if (v[0]==v[1]) {
			cout << "YES" << endl;	
			continue;
		}
		cout << "NO" << endl;
		continue;
	}
	return 0;
}