#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>

typedef long long Int;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
using namespace std;

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

	REP(i, n){

		double p[8];
		REP(i, 8){
			cin >> p[i];
		}

		double dx1 = (p[0] - p[2]);
		double dx2 = (p[4] - p[6]);
		double dy1 = (p[1] - p[3]);
		double dy2 = (p[5] - p[7]);


		if (!dx1||!dx2){
			cout << "NO" << endl;
			continue;
		}

		string ans = (dy2/dx2 == dy1/dx1) ? "YES" : "NO";


		cout << ans << endl;
	}
	return 0;
}