#include <iostream>
#include <math.h>
using namespace std;

int main()
{
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double slope_ab, slope_cd;
	int loop;
	int i = 0;

	cin >> loop;

	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){

		slope_ab = (y2-y1) / (x2-x1);
		slope_cd = (y4-y3) / (x4-x3);

		if(fabs(slope_ab - slope_cd) < 1.0E-10){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
}