Adam is standing at point $(a,b)$ in an infinite 2D grid. He wants to know if he can reach point $(x,y)$ or not. The only operation he can do is to move to point $(a+b,b),(a,a+b),(a-b,b),\text{or}(a,b-a)$ from some point $(a,b)$. It is given that he can move to any point on this 2D grid, i.e., the points having positive or negative $\mbox{X}$(or $\mathbf{Y}$) co-ordinates.  

Tell Adam whether he can reach $(x,y)$ or not.

Input Format

The first line contains an integer, $\mathbf{T}$, followed by $\mathbf{T}$ lines, each containing $4$ space-separated integers i.e. $\boldsymbol{a}$, $\boldsymbol{b}$, $\boldsymbol{x}$ and $y$.  

Constraints

$1\leq T\leq1000$  
$1\leq a,b,x,y\leq10^{18}$ 

Output Format

For each test case, display YES or NO that indicates if Adam can reach $(x,y)$ or not.  

Sample Input
3
1 1 2 3
2 1 2 3
3 3 1 1

Sample Output
YES
YES
NO

Explanation

(1,1) -> (2,1) -> (2,3).

Difficulty: EASY

Solutions:
t = int(input())

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while b > 0:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(a, b, x, y) = [int(_) for _ in input().split()]
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
T = int(input())
for t in range(T):
	(a, b, x, y) = map(int, input().split())
	print('YES' if gcd(abs(a), abs(b)) == gcd(abs(x), abs(y)) else 'NO')


t = int(input())

def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def canon(a, b):
	if a == 0 or b == 0:
		return (0, abs(a) + abs(b))
	if abs(a) < abs(b):
		return canon(a, b % a)
	return canon(a % b, b)
T = int(input())
for i in range(T):
	(a, b, x, y) = (int(i) for i in input().split())
	print('YES' if canon(a, b) == canon(x, y) else 'NO')


def g(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for test_case in range(T):
	(a, b, x, y) = (int(x) for x in input().split())
	if g(x, y) == g(a, b):
		print('YES')
	else:
		print('NO')


import sys
inp = sys.stdin.read()
inp = inp.split(sep='\n')
T = int(inp.pop(0))

def EuclidGCD(a, b):
	if a == b:
		return a
	elif a == 0 or b == 0:
		return a + b
	if a < b:
		t = b
		b = a
		a = t
	q = a // b
	r = a % b
	return EuclidGCD(b, r)
for i in range(T):
	(a, b, x, y) = map(int, inp[i].split())
	if EuclidGCD(abs(a), abs(b)) == EuclidGCD(abs(x), abs(y)):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if a > b:
		(a, b) = (b, a)
	while a > 0:
		(a, b) = (b % a, a)
	return b
T = int(input())
for _ in range(T):
	(a, b, x, y) = [int(_) for _ in input().split(' ')]
	if gcd(x, y) == gcd(a, b):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
for t in range(int(input())):
	(a, b, x, y) = [int(i) for i in input().split()]
	gcd1 = gcd(a, b)
	gcd2 = gcd(x, y)
	if gcd2 == gcd1:
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	while b != 0:
		a %= b
		(a, b) = (b, a)
	return a
for _ in range(int(input())):
	(a, b, x, y) = map(int, input().strip().split())
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	while b > 0:
		rem = a % b
		a = b
		b = rem
	return a
t = int(input())
while t > 0:
	t -= 1
	[a, b, x, y] = [int(k) for k in input().split()]
	GCDab = gcd(a, b)
	GCDxy = gcd(x, y)
	if GCDab == GCDxy:
		print('YES')
	else:
		print('NO')


def GCD(x, y):
	while x % y != 0:
		(x, y) = (y, x % y)
	return y
tests = int(input())
while tests > 0:
	tests -= 1
	(x, y, a, b) = map(int, input().split())
	if GCD(x, y) == GCD(a, b):
		print('YES')
	else:
		print('NO')


test = int(input())

def gcd(a, b):
	if a % b == 0:
		return b
	else:
		return gcd(b, a % b)
for t in range(test):
	(a, b, c, d) = map(int, input().split())
	if gcd(a, b) == gcd(c, d):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if a == b:
		return a
	while a > b:
		a -= b
	if a == 0:
		return b
	if b == 0:
		return a
	return gcd(b, a)
N = int(input())
for i in range(N):
	inp = [int(x) for x in input().split()]
	if gcd(inp[0], inp[1]) == gcd(inp[2], inp[3]):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if b > a:
		swap = a
		a = b
		b = swap
	while b != 0:
		t = b
		b = a % b
		a = t
	return a
T = int(input())
for loop in range(T):
	abxy = list(map(int, input().split()))
	if gcd(abxy[0], abxy[1]) == gcd(abxy[2], abxy[3]):
		print('YES')
	else:
		print('NO')


def gcd(x, y):
	if x == y:
		return x
	if x == 0:
		return y
	if y == 0:
		return x
	while x != 0 and y != 0:
		if x > y:
			temp = x
			x = y
			y = temp
		y = y % x
	return x

def main():
	t = int(input())
	for i in range(t):
		(a, b, x, y) = input().split()
		(a, b, x, y) = (int(a), int(b), int(x), int(y))
		if gcd(a, b) == gcd(x, y):
			print('YES')
		else:
			print('NO')
main()


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
T = int(input())
for _ in range(T):
	(a, b, x, y) = [int(i) for i in input().split()]
	print('YES' if gcd(a, b) == gcd(x, y) else 'NO')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
for _ in range(int(input())):
	(x, y, a, b) = input().split()
	if gcd(int(x), int(y)) == gcd(int(a), int(b)):
		print('YES')
	else:
		print('NO')


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
for i in range(int(input())):
	(a, b, x, y) = input().split()
	(a, b, x, y) = (int(a), int(b), int(x), int(y))
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def GCD(a, b):
	return GCD(b, a % b) if b else a
t = int(input())
for _ in range(t):
	(a, b, x, y) = list(map(int, input().split()))
	print('YES' if GCD(a, b) == GCD(x, y) else 'NO')


def gcd(m, n):
	(m, n) = (max(m, n), min(m, n))
	while m % n != 0:
		(m, n) = (n, m % n)
	return n
t = int(input())
for each in range(t):
	(a, b, x, y) = input().strip().split()
	(a, b, x, y) = (int(a), int(b), int(x), int(y))
	if gcd(abs(a), abs(b)) == gcd(abs(x), abs(y)):
		print('YES')
	else:
		print('NO')


from fractions import *
t = int(input())
for i in range(t):
	(a, b, c, d) = input().split()
	(a, b, c, d) = (int(a), int(b), int(c), int(d))
	if gcd(a, b) == gcd(c, d):
		print('YES')
	else:
		print('NO')


def greatest_common_divisor(a, b):
	if a == 0 or b == 0:
		return max(a, b)
	a = abs(a)
	b = abs(b)
	while a != b:
		if a > b:
			a -= b
		else:
			b -= a
	return a

def solve(test_case):
	(a, b, x, y) = [int(i) for i in test_case.split(' ')]
	if a == b == x == y == 0:
		return 'YES'
	if a == b == 0 or x == y == 0:
		return 'NO'
	if greatest_common_divisor(x, y) == greatest_common_divisor(a, b):
		return 'YES'
	else:
		return 'NO'
num_test_cases = int(input())
for i in range(num_test_cases):
	test_case = input()
	print(solve(test_case))


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def main():
	t = int(input())
	for x in range(t):
		(a, b, x, y) = list(map(int, input().split()))
		if gcd(a, b) == gcd(x, y):
			print('YES')
		else:
			print('NO')
main()


N = int(input())

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)
for x in range(N):
	temp = list(map(int, input().split()))
	a = temp[0]
	b = temp[1]
	x = temp[2]
	y = temp[3]
	if GCD(a, b) == GCD(x, y):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if a > b:
		m = a
		n = b
	else:
		n = a
		m = b
	while n != 0:
		tmp = m
		m = n
		n = tmp % m
	return m
testCases = input()
for i in range(int(testCases)):
	inp = input()
	inp = inp.split()
	for j in range(len(inp)):
		inp[j] = int(inp[j])
	d1 = gcd(inp[0], inp[1])
	d2 = gcd(inp[2], inp[3])
	if d1 == d2:
		print('YES')
	else:
		print('NO')


def GCD(a, b):
	if a == 0:
		return b
	return GCD(b % a, a)
T = int(input())
for _ in range(T):
	[a, b, x, y] = list(map(int, input().split()))
	t1 = GCD(a, b)
	t2 = GCD(x, y)
	if t2 == t1:
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def solve():
	(a, b, c, d) = map(int, input().split())
	if a < 0:
		a = -a
	if b < 0:
		b = -b
	if d < 0:
		d = -d
	if c < 0:
		c = -c
	if a < b:
		t = a
		a = b
		b = t
	common = gcd(a, b)
	if c < d:
		t = c
		c = d
		d = t
	second = gcd(c, d)
	if common == second:
		print('YES')
	else:
		print('NO')
n = int(input())
while n > 0:
	n = n - 1
	solve()


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
T = int(input())
for i in range(0, T):
	(a, b, x, y) = map(int, input().split(' '))
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


T = int(input())
while T > 0:
	line = input().split(' ')
	a = int(line[0])
	b = int(line[1])
	x = int(line[2])
	y = int(line[3])
	while a != b:
		if a > b:
			a = a - b
		else:
			b = b - a
	while x != y:
		if x > y:
			x = x - y
		else:
			y = y - x
	if a == x:
		print('YES')
	else:
		print('NO')
	T = T - 1


t = int(input())

def nwd(a, b):
	if b > a:
		return nwd(b, a)
	return b if a % b == 0 else nwd(a % b, b)
for case in range(t):
	(a, b, x, y) = tuple(map(int, input().split()))
	print('YES' if nwd(a, b) == nwd(x, y) else 'NO')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
t = int(input())
while t != 0:
	a = list(map(int, input().split()))
	if gcd(a[0], a[1]) == gcd(a[2], a[3]):
		print('YES')
	else:
		print('NO')
	t -= 1


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print('YES' if gcd(a, b) == gcd(x, y) else 'NO')


def gcd(a, b):
	if b > a:
		(a, b) = (b, a)
	while True:
		r = a % b
		if r == 0:
			return b
		(a, b) = (b, r)
	return 1
ncases = int(input())
for i in range(ncases):
	(a, b, c, d) = [int(x) for x in input().split()]
	if gcd(a, b) == gcd(c, d):
		print('YES')
	else:
		print('NO')


def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x

def reachable(a, b, x, y):
	if gcd(a, b) == gcd(x, y):
		return 'YES'
	else:
		return 'NO'

def main():
	n = int(input())
	for i in range(0, n):
		ar = input().split()
		a = int(ar[0])
		b = int(ar[1])
		x = int(ar[2])
		y = int(ar[3])
		print(reachable(a, b, x, y))
main()


def gcd(a, b):
	if a > b:
		remainder = a % b
		if remainder:
			return gcd(remainder, b)
		else:
			return b
	else:
		remainder = b % a
		if remainder:
			return gcd(a, remainder)
		else:
			return a

def is_accessible(a, b, x, y):
	gcd_ab = gcd(a, b)
	gcd_xy = gcd(x, y)
	if gcd_ab == gcd_xy:
		return True
	return False
nums = int(input())
for i in range(0, nums):
	(a, b, x, y) = [int(v) for v in input().split()]
	if is_accessible(a, b, x, y):
		print('YES')
	else:
		print('NO')


def gcd(p, q):
	if p == 0:
		return q
	else:
		return gcd(q % p, p)
t = int(input())
while t > 0:
	t = t - 1
	abxy = input()
	abxy = abxy.split()
	a = int(abxy[0])
	b = int(abxy[1])
	x = int(abxy[2])
	y = int(abxy[3])
	c = gcd(a, b)
	d = gcd(x, y)
	if c == d:
		print('YES')
	else:
		print('NO')


def GCD(a, b):
	if a % b == 0:
		return b
	else:
		return GCD(b, a % b)
T = int(input())
while T:
	(a, b, x, y) = list(map(int, input().split()))
	if GCD(a, b) == GCD(x, y):
		print('YES')
	else:
		print('NO')
	T = T - 1


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)

def main():
	for _ in range(int(input())):
		(x1, y1, x2, y2) = map(int, input().split())
		if gcd(x1, y1) == gcd(x2, y2):
			print('YES')
		else:
			print('NO')
	return 0
main()


import sys

def read_num():
	return int(sys.stdin.readline())

def read_nums():
	return list(map(int, sys.stdin.readline().split(' ')))

def get_gcd(a, b):
	if b > a:
		(a, b) = (b, a)
	while a % b != 0:
		(a, b) = (b, a % b)
	return b
n = read_num()
for i in range(0, n):
	l = read_nums()
	a = l[0]
	b = l[1]
	x = l[2]
	y = l[3]
	gcd = get_gcd(a, b)
	gcd2 = get_gcd(x, y)
	if gcd == gcd2:
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n_tests = int(input())
for t in range(n_tests):
	(a, b, x, y) = map(int, input().split())
	print('YES' if gcd(abs(a), abs(b)) == gcd(abs(x), abs(y)) else 'NO')


t = int(input())

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')


def get_gcd(a, b):
	(a, b) = (abs(n) for n in (a, b))
	while b > 0:
		(a, b) = (b, a % b)
	return a

def is_reachable(a, b, x, y):
	return get_gcd(a, b) == get_gcd(x, y)
T = int(input())
for t in range(T):
	(a, b, x, y) = (int(n) for n in input().strip().split())
	reachable = is_reachable(a, b, x, y)
	print('YES' if reachable else 'NO')


def MCD(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
T = int(input())
for i in range(0, T):
	data = input().split()
	a = int(data[0])
	b = int(data[1])
	x = int(data[2])
	y = int(data[3])
	if MCD(a, b) == MCD(x, y):
		print('YES')
	else:
		print('NO')


import math

def gcd(a, b):
	if a == 0:
		return b
	if b == 0:
		return a
	if a == b:
		return a
	if a < b:
		tmp = a
		a = b
		b = tmp
	return gcd(b, a % b)
n = int(input())
for i in range(0, n):
	(x0, y0, x1, y1) = input().split()
	(x0, y0, x1, y1) = (int(x0), int(y0), int(x1), int(y1))
	x0 = abs(x0)
	x1 = abs(x1)
	y0 = abs(y0)
	y1 = abs(y1)
	if gcd(x0, y0) == gcd(x1, y1):
		print('YES')
	else:
		print('NO')


def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
t = int(input().strip())
for j in range(t):
	(a, b, x, y) = [int(i) for i in input().strip().split(' ')]
	if gcd(a, b) == gcd(x, y):
		print('YES')
	else:
		print('NO')