#include <bits/stdc++.h>

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(i, n) REP (i, 0, n)
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;

int main() {
	int n; cin >> n;
	while (n--) {
		double x1, y1, x2, y2, x3, y3, x4, y4;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		// 対角線の中点で判定
		// double cx1 = (x3 - x1) / 2.0;
		// double cy1 = (y3 - y1) / 2.0;
		// double cx2 = (x4 - x2) / 2.0;
		// double cy2 = (y4 - y2) / 2.0;
		// if (cx1 == cx2 && cy1 == cy2) {
		//  cout << "YES" << endl;
		// } else {
		//  cout << "NO" << endl;
		// }
		// 傾きで判定
		if ((y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3)) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}