for _ in range(int(input())): a,b,c,d,e,f,g,h = map(int,input().split()) i = (a,b,c,d)==(e,f,g,h) j = (a-c)**2+(b-d)**2>(e-g)**2+(f-h)**2 k = (a-c)*(f-h)==(b-d)*(e-g) print("Yes" if i or j and k else "No")