#include <iostream>
     
int main() {
    int n;
    std::cin >> n;
    while(n--){
		double x1, y1, x2, y2, x3, y3, x4, y4;
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		int ix1 = x1*10000, iy1 = y1*10000, ix2 = x2*10000, iy2 = y2*10000,
			ix3 = x3*10000, iy3 = y3*10000, ix4 = x4*10000, iy4 = y4*10000;
		int a = iy1 - iy2, b = ix2 - ix1, c = iy3 - iy4, d = ix4 - ix3;
		if(!((long long int)a*d - (long long int)b*c))
			std::cout << "YES" << std::endl;
		else
			std::cout << "NO" << std::endl;
		}
    return 0;
}