#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
#include <stack>
#include <math.h>

using namespace std;
typedef long long Int;
#define REP(i , x) for(Int i = 0 ; i < x ; ++i)
typedef pair<int, int> P;


int main()
{
	int n;
	cin >> n;

	REP(i, n){
		double x1, y1, x2, y2, x3, y3, x4, y4;

		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

		x1 *= 1000000;
		x2 *= 1000000;
		x3 *= 1000000;
		x4 *= 1000000;
		y1 *= 1000000;
		y2 *= 1000000;
		y3 *= 1000000;
		y4 *= 1000000;

		double dx1 = x2 - x1;
		double dx2 = x4 - x3;
		double dy1 = y2 - y1;
		double dy2 = y4 - y3;

		double ww = dy1 / dx1;
		double www = dy2 / dx2;

		string ans = (dy1 / dx1 == dy2 / dx2) ? "YES" : "NO";

		if (!dx1 || !dx2){
			ans = "NO";
		}

		cout << ans << endl;
	}
	return 0;
}