#include<iostream>

using namespace std;

struct Point
{
	double x;
	double y;
};

struct Line
{
	Point* start;
	Point* end;
};

double calcSlope(Line l) {
	return (l.end->y - l.start->y) / (l.end->x - l.start->x);
}



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

	for (int i = 0; i < 2; ++i) {
		Point p1, p2, p3, p4;
		cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y >> p4.x >> p4.y;
		Line l1{ &p1, &p2 }, l2{ &p3, &p4 };
		
		if (calcSlope(l1) != calcSlope(l2)) {
			cout << "NO" << endl;
		}
		else {
			cout << "YES" << endl;
		}

	}

	return 0;
}