#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

#define endl '\n'

typedef long long ll;
typedef long double lb;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y, int x, int H, int W)
{ 
  return (y >= 0 && x >= 0 && y < H && x < W);
}

inline int in() {int x; std::cin >> x; return x;}

const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  double x1, y1, x2, y2, x3, y3, x4, y4;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
    if ((x1 == x2 && x3 == x4) || (((y2 - y1) / (x2 - x1)) == ((y4 - y3) / (x4 - x3)))) cout << "YES" << endl;

    else cout << "NO" << endl;
  }
  return (0);
}