#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 q1 = (p[3] - p[1]) / (p[2] - p[0]);
		double q2 = (p[7] - p[5]) / (p[6] - p[4]);
		string ans = (q1 == q2) ? "YES" : "NO";


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