#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.pl", "r", stdin);
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	int i,j;
	for (i = 0; i < n; ++i){
		vector <double> px (4, 0.0);
		vector <double> py (4, 0.0);
		getline (cin, str );
		stringstream ss(str);
		for (j = 0; j < 4; ++j){
			ss >> px[j] >> py[j];
		} // end for
		map <double, double> v;

		for (j = 0; j < 2; ++j){
			v[px[2*j + 1] - px[2*j]] = py[2*j + 1] - py[2*j];
		} // end for
		if (v.size() == 1){
			cout << "YES" << endl;
			continue;
		} // end if
		map <double, double>::iterator it = v.begin();
		double x = (*it).first;
		double y = (*it).second;
		++it;
		if ( fabs( (*it).first/x - (*it).second/y ) < 1e-6 ){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
	} // end for
		
	return 0;
}