//#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
//#include <vector>
#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	int n;
	double p[8];

	cin >> n;

	while (n--){
		for (int i = 0; i < 8; i++){
			cin >> p[i];
		}

		if (p[0] == p[2] || p[4] == p[6]){
			if (p[0] == p[2] && p[4] == p[6])cout << "YES" << endl;
			else cout << "NO" << endl;
		}
		else{
			if ((p[3] - p[1]) / (p[2] - p[0]) == (p[7] - p[5]) / (p[6] - p[4])) cout << "YES" << endl;
			else cout << "NO" << endl;
		}


	}


	return 0;
}