#include <iostream>
#include <complex>
using namespace std;
typedef complex<double> P;
const double EPS = 1e-9;
int main(){
	int N;
	cin >> N;
	while(N--){
		P a,b,c,d;
		cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag();
		P one = a-b;
		P two = c-d;
		bool f = false;
		if( abs(one.imag()) < EPS || abs(two.imag()) < EPS ){
			f = abs(one.imag()) < EPS && abs(two.imag()) < EPS;
		}else{
			f = abs(one.real()/one.imag() - two.real()/two.imag()) < EPS;
		}
		cout << (f?"YES":"NO") << endl;
	}
}