#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>
#include <utility>
#include <queue>
#include <stack>

using namespace std;
int INF = 99999999;
int main(){

	int n;
	cin >> n;

	double x1, y1, x2, y2, x3, y3, x4, y4;

	for(int i=0 ; i<n ; i++){
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

		double steep1, steep2;

		if(y1 == y2){
			steep1 = 0;
		}else if(x1==x2){
			steep1 = INF;
		}else{
			steep1 = (x2-x1)/(y2-y1);
		}

		if(y3==y4){
			steep2 = 0;
		}else if(x3==x4){
			steep2 = INF;
		}else{
			steep2 = (x4-x3)/(y4-y3);
		}

		if(steep1 == steep2) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}