#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(){
	double p[8];
	int n;
	cin >> n;

	REP(i, n){

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

		string ans = (p[3] - p[1])*(p[6] - p[4]) == (p[7] - p[5])*(p[2] - p[0]) ? "YES" : "NO";


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