#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
//#define scanf scanf_s

int main()
{
	int n;
	cin >> n;
	REP(i, n)
	{
		double xa, ya, xb, yb, xc, yc, xd, yd;
		cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
		double ab, cd;
		if (xa == xb) ab = INF;
		else ab = (ya - yb) / (xa - xb);
		if (xc == xd) cd = INF;
		else cd = (yc - yd) / (xc - xd);
		if (ab == cd) cout << "YES" << endl;
		else cout << "NO" << endl;
		
	}
	return 0;
}