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

int main() {
  int n;
  cin >> n;
  while(n--) {
    double a[4][2];

    for(int i=0; i<4; i++) cin >> a[i][0] >> a[i][1];
    if(abs((a[3][0]-a[2][0])*(a[1][1]-a[0][1])-(a[1][0]-a[0][0])*(a[3][1]-a[2][1]))<1e-10) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}
