#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<string>
#include<functional>
#include<queue>
#include<stack>
#include<math.h>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;


int main()
{
	int n;
	cin >> n;
	int x1, y1, x2, y2, x3, y3, x4, y4;
	for(int i=0;i<n;i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		int a = (y2 - y1)*(x4 - x3) - (y4 - y3)*(x2 - x1);
		if (a - 1 < EPS )printf("YES\n");
		else printf("NO\n");
	}
	
	return 0;
}