#include using namespace std; int main() { int T; cin >> T; while(T--) { int x1, y1, x2, y2, X1, Y1, X2, Y2; cin >> x1 >> y1 >> x2 >> y2 >> X1 >> Y1 >> X2 >> Y2; if((x1 == X1) && (y1 == Y1) && (x2 == X2) && (y2 == Y2)) { cout << "Yes" << endl; continue; } if((y1 == y2 && Y1 != Y2) || (x1 == x2 && X1 != X2)) { cout << "No" << endl; continue; } if((long long)(y2-y1)*(long long)(X2-X1) == (long long)(Y2-Y1) * (long long)(x2-x1)) { if(((long long)(Y2-Y1) * (long long)(Y2-Y1) + (long long)(X2-X1) * (long long)(X2-X1)) < ((long long)(y2-y1) * (long long)(y2-y1) + (long long)(x2-x1) * (long long)(x2-x1))) { cout << "Yes" << endl; }else { cout << "No" << endl; } }else { cout << "No" << endl; } } return 0; }