Mr. Pr and Ms. Ad are at $a$ and $b$ respectively on an infinite number line. Mr. Pr wants to meet Ms. Ad.
Mr. Pr can choose to move  $c$ or $d$ units in 1 second. If Mr. Pr moves $c$ units then Ms. Ad will move $d$ units and vice versa. (Both of them always moved in positive x-direction)
You have to determine if Mr. Pr can meet with Ms. Ad after some integral amount of time, given that Mr. Pr chooses optimally. Note that meeting after a fractional amount of time does not count.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains four space separated integers, $a$, $b$, $c$, and $d$.

-----Output:-----
- For each test case, output a single line containing "YES" if Mr. Pr meets with Ms. Ad, otherwise "NO".

-----Constraints-----
- $1 \leq T \leq 10^5$
- $1 \leq a,b,c,d \leq 10^9$

-----Sample Input:-----
2
3 4 1 2
10 20 3 7

-----Sample Output:-----
YES
NO

-----Explanation:-----
In the first test case, Mr. Pr will move 2 units in the first second and Ms. Ad moves 1 unit simultaneously and they meet. 
In the second test case, it is impossible to meet (fractional time is not allowed).

Starter code:

Solutions:
for _ in range(int(input())):
    a,b,c,d=list(map(int,input().split()))
    if(a==b):
        print('YES')
    elif(c==d):
        print('NO')
    
    else:
        if(abs(a-b)%abs(c-d)==0):
            print('YES')
        else:
            print('NO')


# cook your dish here
# COPIED FROM SDG
import math
for _ in range(int(input())):
    a,b,c,d=map(int,input().split())
    ans1=abs(a-b)
    if ans1==0:
        print("YES")
    else:
        ans2=abs(c-d)
        if ans2==0:
            print("NO")
        else:
            ans=ans1/ans2
            if math.floor(ans)==math.ceil(ans):
                print("YES")
            else:
                print("NO")

from math import *
t=int(input())
for i in range(t):
    a,b,c,d=list(map(int,input().split()))
    y=abs(c-d)
    x=abs(a-b)
    if(y==0):
        if(x==0):
            print("YES")
        else:
            print("NO")
        continue
        
    x=x/y
    if(ceil(x)==floor(x)):
        print("YES")
    else:
        print("NO")


for testcase in range(int(input())):
    a, b, c, d = list(map(int, input().split()))

    val = abs(c - d)

    if a != b and c == d:
        print('NO')
    elif val == 0:
        print('YES')
    else:
        if abs(a - b) % val == 0:
            print('YES')
        else:
            print('NO')


from math import *
t=int(input())
for i in range(t):
    a,b,c,d=list(map(int,input().split()))
    y=abs(c-d)
    x=abs(a-b)
    if(y==0):
        if(x==0):
            print("YES")
        else:
            print("NO")
        continue
        
    x=x/y
    if(ceil(x)==floor(x)):
        print("YES")
    else:
        print("NO")


# cook your dish here
def main():
    t=int(input())
    for _ in range(t):
        a,b,c,d=list(map(int,input().split()))
        if a==b:
            print("YES")
            continue;
        if (a!=b and c==d):
            print("NO")
            continue
        if(abs(b-a)%(max(c,d)-min(c,d))==0):
            print("YES")
        else:
            print("NO")
main()

# cook your dish here
n=int(input())
for i in range(n):
    l=list(map(int,input().split()))
    a=min(l[0],l[1])
    b=max(l[0],l[1])
    c=min(l[2],l[3])
    d=max(l[2],l[3])
    if(d!=c):
        d=d-c
        t=(b-a)//d
        a=a+(t*d)
        if(a==b):
            print("YES")
        else:
            print("NO")
    else:
        if(a!=b):
            print("NO")
        else:
            print("YES")      
        


for t in range(int(input())):
    a,b,c,d=[int(x) for x in input().split()]
    if c==d and a!=b:
        print("NO")
    elif c==d and a==b:
        print("YES")
    elif abs(a-b)/abs(c-d)==abs(a-b)//abs(c-d):
        print("YES")
    else:
        print("NO")


n=int(input())
for i in range(n):
    l=list(map(int,input().split()))
    a=min(l[0],l[1])
    b=max(l[0],l[1])
    c=min(l[2],l[3])
    d=max(l[2],l[3])
    if(d!=c):
        d=d-c
        t=(b-a)//d
        a=a+(t*d)
        if(a==b):
            print("YES")
        else:
            print("NO")
    else:
        if(a!=b):
            print("NO")
        else:
            print("YES")


for _ in range(int(input())):
    a,b,c,d = map(int, input().split())
    if c == d and a != b:
        print('NO')
    elif c == d and a == b:
        print('YES')
    else:
        t = abs(a-b)/abs(c-d)
        if t%1 == 0:
            print('YES')
        else:
            print('NO')

# cook your dish here
import math
p=int(input())
while(p>0):
    a,b,c,d=input().split()
    a=int(a)
    b=int(b)
    c=int(c)
    d=int(d)
    if d==c:
        if a==b:
            print("YES")
        else:
            print("NO")
    else:
        m=((a-b)%(c-d))
        if(m==0):
            print("YES")
        else:
            print("NO")
    p=p-1


x=int(input())
t=[]
for i in range(x):
    q=list(map(int,input().split()))
    a=q[0]
    b=q[1]
    c=q[2]
    d=q[3]
    y=max(c,d)
    z=min(c,d)
    if(a==b):
        print("YES")
    elif(y==z):
        print("NO")
    elif((b-a)/(y-z)==(b-a)//(y-z)):
        print("YES")
    else:    
        print("NO")
            
    


T=int(input())
while T>0:
    T-=1
    A,B,C,D=map(int,input().split())
    res1=max(C,D)
    res2=min(C,D)
    val1=B-A
    val2=res2-res1
    val1=abs(val1)
    val2=abs(val2)
    if val2!=0:
        if val1%val2==0:
            print("YES")
        else:
            print("NO")
    elif val1==0 and val2==0:
        print("YES")
    else:
        print("NO")

# cook your dish he

t=int(input())
while(t>0):
    a,b,c,d=map(int,input().rstrip().split())
    a1=abs(a-b)
    a2=abs(c-d)
    
    if a1==0 and a2==0:
        print("YES")
        
    elif a1==0 or a2==0:
        print("NO")
            
    elif a1>=a2:
        if a1%a2==0:
            print("YES")
        else:
            print("NO")    
    elif a2>a1:
        print("NO")    
    
    t-=1

t=int(input())
f=[]
for i in range(t):
    a,b,c,d=map(int,input().split())
    if abs(c-d)==0 and a==b:
        f.append('YES')
        continue
    if abs(c-d)==0 and a!=b:
        f.append('NO')
        continue
    if a==b:
        f.append('YES')
    elif abs(a-b)%abs(c-d)==0:
        f.append('YES')
    elif abs(a-b)%abs(c-d)!=0:
        f.append('NO')
for i in range(t):
    print(*f[i],sep='')



for _ in range(int(input())):
    a,b,c,d=list(map(int,input().split()))
    
    if a>b:
        e=a-b
    else:
        e=b-a
        
    if c>d:
        f=c-d
    else:
        f=d-c

    if f != 0:
        if e%f == 0:
            print("YES")
        else:
            print("NO")
    else:
        if e == 0:
            print("YES")
        else:
            print("NO")



for _ in range(int(input())):
    a,b,c,d=list(map(int,input().split()))
    
    if a>b:
        e=a-b
    else:
        e=b-a
        
    if c>d:
        f=c-d
    else:
        f=d-c

    if f != 0:
        if e%f == 0:
            print("YES")
        else:
            print("NO")
    else:
        if e == 0:
            print("YES")
        else:
            print("NO")


for _ in range(int(input())):
    a,b,c,d=list(map(int,input().split()))
    st="YES"
    sad,spr=0,0
    if a==b:
        st="YES"
    elif a>b:
        sad,spr=max(c,d),min(c,d) 
        if sad==spr:
            st="NO"
        else:
            if (a-b)%(sad-spr)==0:
                st="YES"
            else:
                st="NO"
    else:
        sad,spr=min(c,d),max(c,d) 
        if sad==spr:
            st="NO"
        else:
            if (-a+b)%(-sad+spr)==0:
                st="YES"
            else:
                st="NO"
    print(st)
        


t = int(input())
for _ in range(t):
	a,b,c,d = map(int,input().split())
	dis = abs(a-b)
	sp = abs(c-d)
	if sp != 0:
		if dis % sp == 0:
			print('YES')
		else:
			print('NO')
	elif sp ==0 and a==b:
		print('YES')
	else:
		print('NO')

# cook your dish here
t=int(input())
for i in range(t):
    a,b,c,d=list(map(int,input().split()))
    if c==d:
        if a==b:
            print("YES")
        else:
            print("NO")
    elif abs(a-b)%abs(c-d)==0:
        print("YES")
        
    else:
        print("NO")


# cook your dish here
import math
test=int(input())
while(test>0):
    a,b,c,d=input().split()
    a=int(a)
    b=int(b)
    c=int(c)
    d=int(d)
    
    if d==c:
        if a==b:
            print("YES")
        else:
            print("NO")
    else:
        m=abs((a-b)/(c-d)) 
        if int(m)==m:
            if min(a,b)+(max(c,d)*m-1)==max(a,b)+(min(c,d)*m-1):
                print("YES")
            else:
                print("NO")
        
        else:
            m=math.ceil(m)
            if min(a,b)+(max(c,d)*m)==max(a,b)+(min(c,d)*m):
                print("YES")
            else:
                print("NO")
    test=test-1


import math
t=int(input())
while(t>0):
    a,b,c,d=input().split()
    a=int(a)
    b=int(b)
    c=int(c)
    d=int(d)
    if d==c:
        if a==b:
            print("YES")
        else:
            print("NO")
    else:
        m=((a-b)%(c-d))
        if(m==0):
            print("YES")
        else:
            print("NO")
    t=t-1


t=int(input())
for i in range(t):
    a,b,c,d=map(int,input().split())
    if(abs(c-d))==0:
        if a==b:
            print("YES")
        else:
            print("NO")
    elif (abs(a-b))%(abs(c-d))==0:
        print("YES")
    else:
        print("NO")

# cook your dish here
import math
t=int(input())
while(t>0):
    a,b,c,d=input().split()
    a=int(a)
    b=int(b)
    c=int(c)
    d=int(d)
    
    if d==c:
        if a==b:
            print("YES")
        else:
            print("NO")
    else:
        m=abs((a-b)/(c-d)) 
        if int(m)==m:
            if min(a,b)+(max(c,d)*m-1)==max(a,b)+(min(c,d)*m-1):
                print("YES")
            else:
                print("NO")
        
        else:
            m=math.ceil(m)
            if min(a,b)+(max(c,d)*m)==max(a,b)+(min(c,d)*m):
                print("YES")
            else:
                print("NO")
    t=t-1