#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; string ans("No"); if((x1 == X1) && (y1 == Y1) && (x2 == X2) && (y2 == Y2)) { ans = "Yes"; } if((y1 == y2 && Y1 != Y2) || (x1 == x2 && X1 != X2)) { }else { if((long long)(y2-y1) * (long long)(X2-X1) == (long long)(Y2-Y1) * (long long)(x2-x1)) { if((((x1 < x2) && (X1 < X2)) || ((x2 <= x1) && (X2 <= X1))) && (hypot(X2-X1, Y2-Y1) < hypot(x2-x1, y2-y1))) { ans = "Yes"; } } } cout << ans << endl; } return 0; }