#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#include <cmath>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second

using namespace std;

double x[10],y[10];
double g1,g2;
int tc;

int main()
{
	scanf("%d",&tc);
	while(tc--)
	{
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[4],&y[4]);
		g1=(y[2]-y[1])/(x[2]-x[1]);
		g2=(y[4]-y[3])/(x[4]-x[3]);
		if(g1==g2)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
		//printf("%.2lf,%.2lf\n",g1,g2);
	}
	return 0;
}