#include <bits/stdc++.h>

using namespace std;

int main(){

  int n;
  double p[4][2];

  cin >> n;

  while(n--){

    for(int i = 0; i < 4; ++i){
      for(int j = 0; j < 2; ++j){
	cin >> p[i][j];
      }
    }
    
    if(((p[1][1] - p[0][1]) / (p[1][0] - p[0][0])) == ((p[3][1] - p[2][1]) / (p[3][0] - p[2][0]))) cout << "YES" << endl;
    else cout << "NO" << endl;

  }

}