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 ≤ T ≤ 10^{5}$
$1 ≤ a,b,c,d ≤ 10^{9}$

----- Sample Input 1 ------ 
2
3 4 1 2
10 20 3 7
----- Sample Output 1 ------ 
YES
NO
----- explanation 1 ------ 
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).

Source: codechef | Difficulty: MEDIUM


Solutions:
from math import gcd
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a == b:
		print('YES')
	elif c == d:
		print('NO')
	else:
		dif = abs(a - b)
		speed_dif = abs(c - d)
		if dif % speed_dif:
			print('NO')
		else:
			print('YES')


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


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


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


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


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


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


t = int(input())
while t:
	(a, b, c, d) = map(int, input().split())
	if a == b:
		print('YES')
	elif c == d:
		print('NO')
	elif abs(a - b) % abs(c - d) == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


def main():
	(a, b, c, d) = [int(k) for k in input().split()]
	if a == b:
		print('YES')
		return
	if c - d == 0:
		print('NO')
		return
	if abs(a - b) % abs(c - d) == 0:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	main()


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


for _ in range(int(input())):
	abcde = input()
	abcd = abcde.split()
	a = int(abcd[0])
	b = int(abcd[1])
	c = int(abcd[2])
	d = int(abcd[3])
	if a - b == 0:
		print('YES')
	elif c - d == 0:
		print('NO')
	elif abs(a - b) % abs(c - d) == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if c != d:
		itime = abs(a - b) // abs(c - d)
		ftime = abs(a - b) / abs(c - d)
		if itime - ftime == 0:
			print('YES')
		else:
			print('NO')
	elif a == b:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if c == d:
		if a == b:
			print('YES')
		else:
			print('NO')
		continue
	x = abs(a - b) / abs(c - d)
	y = int(x)
	if x == y:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(a, b, c, d) = [int(x) for x in input().split(' ')]
	if a == b:
		print('YES')
		continue
	elif c == d:
		print('NO')
		continue
	elif abs(a - b) % abs(c - d) == 0:
		print('YES')
	else:
		print('NO')


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


def solve(a, b, c, d):
	if a == b:
		return 'YES'
	if c == d:
		return 'NO'
	if (a - b) % (c - d) == 0:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print(solve(a, b, c, d))


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


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


T = int(input())
for i in range(T):
	a = list(map(int, input().split()))
	d = abs(a[0] - a[1])
	d1 = abs(a[2] - a[3])
	if d == 0:
		print('YES')
		continue
	if d1 == 0:
		print('NO')
		continue
	if d % d1 == 0:
		print('YES')
		continue
	else:
		print('NO')


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	dis = b - a
	step_size = d - c
	if dis == 0:
		print('YES')
		continue
	if step_size == 0:
		print('NO')
		continue
	if dis % step_size == 0:
		print('YES')
	else:
		print('NO')


tests = int(input())
for i in range(tests):
	(a, b, c, d) = map(int, input().split())
	gap = abs(a - b)
	speed_diff = abs(c - d)
	ans = 'NO'
	if gap == 0:
		ans = 'YES'
	if speed_diff != 0 and gap % speed_diff == 0:
		ans = 'YES'
	print(ans)


for _ in range(int(input())):
	(a, b, c, d) = [int(s) for s in input().split()]
	if c != d:
		print('NO' if abs(a - b) % abs(c - d) else 'YES')
	else:
		print('NO' if a != b else 'YES')


t = int(input())
for i in range(t):
	n = [int(x) for x in input().split()]
	mi = min(n[2], n[3])
	ma = max(n[2], n[3])
	m = n[1] - n[0]
	if m == 0:
		print('YES')
	elif ma - mi == 0:
		print('NO')
	elif m % (ma - mi) == 0:
		print('YES')
	else:
		print('NO')


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


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


try:
	t = int(input())
	while t > 0:
		(a, b, c, d) = [int(i) for i in input().split()]
		if a == b:
			print('YES')
		elif c == d:
			print('NO')
		elif (a - b) % (c - d) == 0:
			print('YES')
		else:
			print('NO')
		t = t - 1
except:
	pass


import sys
input = sys.stdin.readline

def trange():
	return range(int(input()))

def splitMap():
	return map(int, input().split())

def listOfNumbers():
	return list(map(int, input().split()))

def simpleString():
	return input()

def main():
	for _ in trange():
		(a, b, c, d) = splitMap()
		if a == b:
			print('YES')
			continue
		behind = min(a, b)
		front = max(a, b)
		distanceBetweenThem = front - behind
		fasterSpeed = max(c, d)
		slowerSpeed = min(c, d)
		relativeSpeedOfPersonBehind = fasterSpeed - slowerSpeed
		if relativeSpeedOfPersonBehind == 0 and distanceBetweenThem > 0:
			print('NO')
			continue
		print('YES' if distanceBetweenThem % relativeSpeedOfPersonBehind == 0 else 'NO')
main()
exit()


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


import sys
input = sys.stdin.readline

def rii():
	return range(int(input().strip()))

def ii():
	return int(input().strip())

def mii():
	return map(int, input().strip().split(' '))

def lmii():
	return list(map(int, input().strip().split(' ')))

def si():
	return str(input().strip())
success = 'YES'
failure = 'NO'

def solve(*args):
	(a, b, c, d) = args
	if c == d:
		return success if a == b else failure
	return success if abs(a - b) % abs(c - d) == 0 else failure

def do_codechef():
	for t in rii():
		(a, b, c, d) = mii()
		print(solve(a, b, c, d))
do_codechef()
exit()


n = int(input())
for i in range(n):
	(a, b, c, d) = list(map(int, input().split()))
	min1 = min(a, b)
	max1 = max(a, b)
	min2 = min(c, d)
	max2 = max(c, d)
	if min1 == max1:
		print('YES')
	elif min2 == max2:
		print('NO')
	elif (max1 - min1) % (max2 - min2) == 0:
		print('YES')
	else:
		print('NO')


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


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a == b:
		print('YES')
	elif a != b and c == d:
		print('NO')
	else:
		x1 = min(a, b)
		x2 = a + b - x1
		y1 = min(c, d)
		y2 = c + d - y1
		a = x2 - x1
		b = y2 - y1
		if a % b == 0:
			print('YES')
		else:
			print('NO')


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