#include<iostream>
#include<string>
using namespace std;

int main(){
  int num;
  double array[4][2];
  cin >> num;
  while(num != 0){
    for(int i = 0; i < 4; i++){
      for(int j = 0; j < 2; j++){
	cin >> array[i][j];
      }
    }
    double N = (array[1][0] - array[0][0]) / (array[1][1] - array[0][1]);
    double M = (array[3][0] - array[2][0]) / (array[3][1] - array[2][1]);
    if(N == M)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    num--;
  }
  


 return 0;

}