#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int n;
	float s, t, m, a, b;
	cin >> n;
	while(n--){
		cin >> a >> b >> s >> t;
		m = (t-b)/(s-a);
		cin >> a >> b >> s >> t;
		if(m == (t-b)/(s-a)){
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	
	return 0;
}