#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)

#define EPS 1e-10

typedef long long ll;

using namespace std;



/*
class TheKingsArmyDiv2
{
public:
	int getNumber(vector <string> state)
	{

	}
};
*/


double a, b, c, d, e, f, g, h;
double det()
{
	double dx1, dy1, dx2, dy2;
	
	dx1 = a - c;
	dy1 = b - d;
	dx2 = e - g;
	dy2 = f - h;
	
	return dx1*dy2 - dy1*dx2;
}


int main()
{
	int n;
	
	cin >> n;
	while (n--)
	{
		cin >> a >> b >> c >> d >> e >> f >> g >> h;
		cout << (fabs(det()) < EPS ? "YES" : "NO") << endl;
	}
	
	return 0;
}