
#include<iostream>
#include <string>
#include<stdio.h>

using namespace std;

int main(int argc, char* argv[])
{
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double tendAB, tendCD;
	int num;

	cin >> num;
	while (num--) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		tendAB = (y1 == y2) ? 0 : (x2 - x1) / (y2 - y1);
		tendCD = (y3 == y4) ? 0 : (x4 - x3) / (y4 - y3);
		if (tendAB == tendCD) cout << "YES" << endl; else cout << "NO" << endl;
	}

	return 0;
}