using System;
class AIDU0021
    {
        public static void Main(){
            double[] facets = new double[8], VAB = new double[2],VCD = new double[2];
            string[] facetstr = new string[8];
            int N=int.Parse(Console.ReadLine()),i=0;
            bool[] result=new bool[N];
            for (int l = 0; l<N; l++) {
                facetstr=Console.ReadLine().Split();
                for (i = 0; i<8; i++) 
                    facets[i]=double.Parse(facetstr[i]);
                for (i = 0; i<2; i++) {
                    VAB[i]=facets[i+2]-facets[i];
                    VCD[i]=facets[i+6]-facets[i+4];
                }
                result[l]= VAB[0]*VCD[1]-VAB[1]*VCD[0]==0.0;
            }
            for (int l = 0; l<N; l++) Console.WriteLine(result[l] ? "YES" : "NO");
        }
    }