Ringo Mart, a convenience store, sells apple juice.

On the opening day of Ringo Mart, there were A cans of juice in stock in the morning. Snuke buys B cans of juice here every day in the daytime. Then, the manager checks the number of cans of juice remaining in stock every night. If there are C or less cans, D new cans will be added to the stock by the next morning.

Determine if Snuke can buy juice indefinitely, that is, there is always B or more cans of juice in stock when he attempts to buy them. Nobody besides Snuke buy juice at this store.

Note that each test case in this problem consists of T queries.

Constraints

* 1 \leq T \leq 300
* 1 \leq A, B, C, D \leq 10^{18}
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


T
A_1 B_1 C_1 D_1
A_2 B_2 C_2 D_2
:
A_T B_T C_T D_T


In the i-th query, A = A_i, B = B_i, C = C_i, D = D_i.

Output

Print T lines. The i-th line should contain `Yes` if Snuke can buy apple juice indefinitely in the i-th query; `No` otherwise.

Examples

Input

14
9 7 5 9
9 7 6 9
14 10 7 12
14 10 8 12
14 10 9 12
14 10 7 11
14 10 8 11
14 10 9 11
9 10 5 10
10 10 5 10
11 10 5 10
16 10 5 10
1000000000000000000 17 14 999999999999999985
1000000000000000000 17 15 999999999999999985


Output

No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes


Input

24
1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1 4 2 3
1 4 3 2
2 1 3 4
2 1 4 3
2 3 1 4
2 3 4 1
2 4 1 3
2 4 3 1
3 1 2 4
3 1 4 2
3 2 1 4
3 2 4 1
3 4 1 2
3 4 2 1
4 1 2 3
4 1 3 2
4 2 1 3
4 2 3 1
4 3 1 2
4 3 2 1


Output

No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
def main():
	import math

	def gcd(a, b):
		while b:
			(a, b) = (b, a % b)
		return a
	N = int(input())
	ABCD = [list(map(int, input().split())) for i in range(N)]
	for (A, B, C, D) in ABCD:
		if A < B or D < B:
			print('No')
			continue
		A %= B
		if C < A:
			print('No')
			continue
		if B == D:
			print('Yes')
			continue
		flag = True
		if (B - A - 1) % gcd(D, B) <= B - 1 - (C + 1):
			flag = False
		print('Yes' if flag else 'No')
main()


from math import ceil

def gcd(a, b):
	assert a > 0 and b > 0
	while b > 0:
		r = a % b
		a = b
		b = r
	return a

def solve(A, B, C, D):
	if A < B or D < B:
		return False
	if A % B > C:
		return False
	if D % B == 0:
		return True
	g = gcd(B, D)
	r = A % g
	return not C < B - g + r
T = int(input())
for i in range(T):
	(A, B, C, D) = [int(t) for t in input().split()]
	print('Yes' if solve(A, B, C, D) else 'No')


T = int(input())

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
for i in range(T):
	(a, b, c, d) = map(int, input().split())
	if a < b:
		print('No')
	elif d < b:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		g = gcd(b, d)
		if b - g + a % g > c:
			print('No')
		else:
			print('Yes')


def gcd(x, y):
	if x < y:
		(x, y) = (y, x)
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if D < B:
		print('No')
		continue
	if A < B:
		print('No')
		continue
	if C >= B:
		print('Yes')
		continue
	a = A % B
	d = D % B
	g = gcd(d, B)
	k = (C - a) // g
	if a + (k + 1) * g >= B:
		print('Yes')
	else:
		print('No')


import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10 ** 9))
write = lambda x: sys.stdout.write(x + '\n')

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

def sub(a, b, c, d):
	x1 = a - max(0, (a - (c + 1)) // b) * b
	if d < b:
		ans = 'No'
	elif a < b:
		ans = 'No'
	elif d % b == 0:
		if x1 >= b:
			ans = 'Yes'
		else:
			ans = 'No'
	else:
		k = gcd(d, b)
		x2 = x1 - (x1 - (c + 1)) // k * k
		if x2 >= b:
			ans = 'Yes'
		else:
			ans = 'No'
	return ans
t = int(input())
ans = []
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	ans.append(sub(a, b, c, d))
write('\n'.join(ans))


def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if B > D or B > A:
		print('No')
		continue
	if C >= B - 1:
		print('Yes')
		continue
	a = A % B
	step = gcd(B, D)
	k = (B - a + step - 1) // step - 1
	if C - a < k * step:
		print('No')
	else:
		print('Yes')


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

class query:

	def __init__(self, a, b, c, d):
		self.a = a
		self.b = b
		self.c = c
		self.d = d

	def isEternal(self):
		if self.a < self.b:
			return 'No'
		if self.d < self.b:
			return 'No'
		if self.b <= self.c:
			return 'Yes'
		g = gcd(self.d, self.b)
		if self.b - g + self.a % g > self.c:
			return 'No'
		return 'Yes'
t = int(input())
querys = [query(*[int(s) for s in input().split()]) for _ in range(t)]
for q in querys:
	print(q.isEternal())


import sys
sys.setrecursionlimit(100000)

def gcd(a, b):
	r = a % b
	if r == 0:
		return b
	else:
		return gcd(b, r)
T = int(input())
for i in range(T):
	(a, b, c, d) = list(map(int, input().split()))
	if a < b:
		print('No')
		continue
	if b > d:
		print('No')
		continue
	if c >= b:
		print('Yes')
		continue
	diff = d % b
	if diff == 0:
		if a % b <= c:
			print('Yes')
			continue
		else:
			print('No')
			continue
	g = gcd(b, diff)
	init_mod = c % b
	base_mod = init_mod % g
	if b + base_mod - g > c:
		print('No')
	else:
		print('Yes')


import sys
n = int(input())
a = []
b = []
c = []
d = []
for j in range(0, n):
	(t1, t2, t3, t4) = (int(i) for i in input().split())
	a.append(t1)
	b.append(t2)
	c.append(t3)
	d.append(t4)
for i in range(0, n):
	if a[i] < b[i]:
		print('No')
	elif d[i] < b[i]:
		print('No')
	else:
		p = b[i]
		q = d[i]
		while p % q:
			r = q
			q = p % q
			p = r
		if b[i] - q + a[i] % q > c[i]:
			print('No')
		else:
			print('Yes')


from math import gcd
t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if b > d or b > a:
		print('No')
	else:
		tmp = gcd(b, d)
		rem = a % tmp
		min_c = (c - rem) // tmp
		if min_c + 1 >= b // tmp:
			print('Yes')
		else:
			print('No')


from math import gcd
t = int(input())
queries = [tuple((int(x) for x in input().split())) for _ in range(t)]
for (a, b, c, d) in queries:
	if a < b:
		print('No')
		continue
	if b > d:
		print('No')
		continue
	if b - c <= 1:
		print('Yes')
		continue
	g = gcd(b, d)
	m = a + (b - a) // g * g
	if m >= b:
		m -= g
	if c < m:
		print('No')
	else:
		print('Yes')


def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
(T, *L) = map(int, open(0).read().split())
for (a, b, c, d) in zip(*[iter(L)] * 4):
	if a < b or d < b:
		flag = False
	elif c >= b - 1:
		flag = True
	else:
		g = gcd(b, d)
		flag = b + a % g - g <= c
	if flag:
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
t = int(input())
abcd_list = [[int(i) for i in input().split()] for _ in range(t)]
for i in range(len(abcd_list)):
	(a, b, c, d) = abcd_list[i]
	if b > a:
		print('No')
		continue
	if b > d:
		print('No')
		continue
	if c > b:
		print('Yes')
		continue
	g = gcd(b, d)
	max_mod_b = b - g + a % g
	if max_mod_b > c:
		print('No')
	else:
		print('Yes')


T = int(input())

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	if b == 0:
		return 0
	while a % b:
		(a, b) = (b, a % b)
	return b
while T:
	T -= 1
	(A, B, C, D) = map(int, input().split())
	if B > A or B > D:
		print('No')
	else:
		p = A - (A - C + B - 1) // B * B
		r = D % B
		g = gcd(r, B - r)
		if p < 0:
			print('No')
		elif r == 0 or (C - r - p + g) // g * g + p - B + r >= 0:
			print('Yes')
		else:
			print('No')


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

def solve():
	(a, b, c, d) = map(int, input().split())
	if d < b:
		return 'No'
	if a < b:
		return 'No'
	if c >= b:
		return 'Yes'
	g = gcd(d, b)
	a %= b
	if (c - a) // g != (b - a - 1) // g:
		return 'No'
	else:
		return 'Yes'
for _ in range(int(input())):
	print(solve())


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
import math
import decimal
ctx = decimal.Context(prec=100, rounding=decimal.ROUND_CEILING)
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a < b:
		print('No')
		continue
	if b > d:
		print('No')
		continue
	if c >= b:
		print('Yes')
		continue
	g = gcd(b, d)
	r = a % g
	_max = int(((decimal.Decimal(b, context=ctx) - decimal.Decimal(r, context=ctx)) / decimal.Decimal(g, context=ctx)).to_integral_exact(context=ctx)) * g + r - g
	if c < _max:
		print('No')
	else:
		print('Yes')


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
list = [map(int, input().split()) for i in range(n)]

def check(num):
	(a, b, c, d) = list[num]
	if a < b:
		return False
	if a % b > c:
		return False
	if b > d:
		return False
	if c < b and d != b:
		if (b - a % b - 1) // gcd(b, d) != (c - a % b) // gcd(b, d):
			return False
	return True
for i in range(n):
	if check(i):
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if B > A:
		print('No')
	elif B > D:
		print('No')
	elif C >= B:
		print('Yes')
	else:
		g = gcd(B, D)
		if B - g + A % g > C:
			print('No')
		else:
			print('Yes')


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

def solve(a, b, c, d):
	if a < b or d < b:
		return True
	cnt = gcd(b, d)
	mi = a - b
	ma = a - c
	if ma - mi > cnt:
		return True
	elif ma - mi <= 1:
		return False
	elif (mi + cnt) // cnt * cnt < ma:
		return True
	else:
		return False
T = int(input())
for i in range(T):
	(A, B, C, D) = map(int, input().split())
	if solve(A, B, C, D):
		print('No')
	else:
		print('Yes')


import fractions as math

def read_ints():
	return [int(c) for c in input().split()]

def solve(a, b, c, d):
	if a < b:
		return False
	if d < b:
		return False
	if c >= b:
		return True
	e = a % b
	delta = d % b
	if delta == 0:
		return e <= c
	g = math.gcd(b, delta)
	maxv = b - g
	return maxv <= c

def main():
	n = int(input())
	for _ in range(n):
		print('Yes' if solve(*read_ints()) else 'No')
main()


T = int(input())
ABCD = [[int(_) for _ in input().split()] for _ in range(T)]

def gcd(x, y):
	if x < y:
		return gcd(y, x)
	elif x % y == 0:
		return y
	else:
		return gcd(y, x % y)
for (a, b, c, d) in ABCD:
	if a < b or d < b:
		print('No')
	else:
		g = gcd(b, d)
		x = g * (c // g) + a % g
		if x <= c:
			x += g
		if x >= b:
			print('Yes')
		else:
			print('No')


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
t = int(input())
a = []
d = 0
for i in range(t):
	a.append(list(map(int, input().split())))
for j in a:
	if j[0] < j[1] or j[1] > j[3]:
		print('No')
	else:
		b = j[0] % j[1]
		k = gcd(j[1], j[3])
		c = j[0] % k
		d = j[2] % k
		if c > d:
			e = j[2] + c - d
		else:
			e = j[2] + k + c - d
		if j[1] > e:
			print('No')
		else:
			print('Yes')


import math
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if b > a:
		print('No')
	elif b > d:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		g = math.gcd(b, d)
		print('Yes' if c >= a % g + b - g else 'No')


import math
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	print('Yes' if b <= min(a, d, c + 1 + (a - c - 1) % math.gcd(b, d)) else 'No')


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if a < b or d < b:
		print('No')
		continue
	if c >= b:
		print('Yes')
		continue
	g = gcd(d, b)
	print('Yes' if b - g + a % g <= c else 'No')


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if A < B or D < B:
		print('No')
	else:
		g = gcd(B, D)
		k = B // g
		r = (A - C) % B
		if r == 0:
			sm = C
		else:
			sm = C + r - B
		if sm < 0:
			print('No')
		else:
			s = sm % g
			if s + (k - 1) * g <= C:
				print('Yes')
			else:
				print('No')


def main(a, b, c, d):
	if a < b:
		return 'No'
	if d < b:
		return 'No'
	if b <= c + 1:
		return 'Yes'
	if d % b == 0:
		if a % b <= c:
			return 'Yes'
		return 'No'
	import math
	g = math.gcd(d % b, b)
	e0 = a % d
	if g * ((b - 1 - e0) // g) + e0 <= c:
		return 'Yes'
	return 'No'
t = int(input())
abcd = [list(map(int, input().split())) for _ in range(t)]
for (a, b, c, d) in abcd:
	print(main(a, b, c, d))


t = int(input())

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	if b == 0:
		return a
	return gcd(b, a % b)
for i in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	if a < b or b > d or a % b > c:
		print('No')
	elif b == d:
		print('Yes')
	elif b - gcd(b, d) <= c:
		print('Yes')
	else:
		print('No')


def solve(P):
	(A, B, C, D) = P
	if A < B or D < B:
		return False
	if C >= B - 1:
		return True
	g = gcd(B, D)
	return B + A % g - g <= C
from math import gcd
T = int(input())
for _ in range(T):
	P = map(int, input().split())
	print('Yes' if solve(P) else 'No')


def i1():
	return int(input())

def i2():
	return [int(i) for i in input().split()]
t = i1()

def gcd(a, b):
	while b:
		if a < b:
			c = b
			b = a
			a = c
		if b:
			a %= b
	return a
for i in range(t):
	[a, b, c, d] = i2()
	if a < b:
		print('No')
	elif d < b:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		g = gcd(b, d)
		x = b - g + a % g
		if x > c:
			print('No')
		else:
			print('Yes')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
a = []
for i in range(T):
	a.append(list(map(int, input().split())))
for r in a:
	(s, b, c, d) = (r[0], r[1], r[2], r[3])
	mod_list = []
	if s < b or b > d:
		print('No')
		continue
	if c > b:
		print('Yes')
		continue
	g = gcd(b, d)
	if b - g + s % g > c:
		print('No')
	else:
		print('Yes')


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(input())
for sdghsoewrgoijof in range(t):
	s = input().split()
	(a, b, c, d) = (int(s[0]), int(s[1]), int(s[2]), int(s[3]))
	if a < b or d < b:
		print('No')
		continue
	if a == b:
		if d < b:
			print('No')
			continue
		elif d == b:
			print('Yes')
			continue
		else:
			a = d
	if a % b > c:
		print('No')
		continue
	if d % b == 0:
		print('Yes')
	else:
		g = gcd(b, d)
		if b + a % g - g > c:
			print('No')
		else:
			print('Yes')


import sys
YES = 'Yes'
NO = 'No'

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

def solve(T: int, A: 'List[int]', B: 'List[int]', C: 'List[int]', D: 'List[int]'):
	for i in range(T):
		(a, b, c, d) = (A[i], B[i], C[i], D[i])
		if a < b or b > d:
			print('No')
			continue
		x = (c - a + 1) % b
		g = gcd(b, d)
		print('No' if -(-x // g * g) - x + c + 1 < b else 'Yes')
	return

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	T = int(next(tokens))
	A = [int()] * T
	B = [int()] * T
	C = [int()] * T
	D = [int()] * T
	for i in range(T):
		A[i] = int(next(tokens))
		B[i] = int(next(tokens))
		C[i] = int(next(tokens))
		D[i] = int(next(tokens))
	solve(T, A, B, C, D)
main()


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
import math
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if a < b:
		print('No')
		continue
	if b > d:
		print('No')
		continue
	if c >= b:
		print('Yes')
		continue
	g = gcd(b, d)
	r = a % g
	_max = (b - r + g - 1) // g * g + r - g
	if c < _max:
		print('No')
	else:
		print('Yes')


import math
t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if a < b or b > d:
		print('No')
		continue
	g = math.gcd(b, d)
	max_rem = b - g + a % g
	if max_rem > c:
		print('No')
	else:
		print('Yes')


T = int(input())

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while b > 0:
		c = a % b
		a = b
		b = c
	return a
YES = 'Yes'
NO = 'No'
for i in range(T):
	(A, B, C, D) = map(int, input().split())
	if D < B or A < B:
		print(NO)
		continue
	D = D % B
	if C >= B:
		print(YES)
		continue
	rest = A % B
	if rest > C:
		print(NO)
		continue
	if D == 0:
		print(YES)
		continue
	g = gcd(B, D)
	left = C - rest
	right = B - rest
	n = left // g + 1
	if n * g < right:
		print(NO)
	else:
		print(YES)


import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

def solve(A, B, C, D):
	if B > A:
		return 'No'
	if B > D:
		return 'No'
	if B <= C:
		return 'Yes'
	g = gcd(B, D)
	if B - g + A % g > C:
		return 'No'
	else:
		return 'Yes'
T = int(input())
for t in range(T):
	(A, B, C, D) = map(int, input().split())
	print(solve(A, B, C, D))


from math import gcd

def solve():
	T = int(input())
	ans = ['No'] * T
	for i in range(T):
		(A, B, C, D) = map(int, input().split())
		if A < B:
			continue
		now = A - -(-(A - C) // B) * B
		if now < 0:
			continue
		if D < B:
			continue
		if D % B == 0:
			ans[i] = 'Yes'
			continue
		if C >= B:
			ans[i] = 'Yes'
			continue
		if B - gcd(D % B, B) > C:
			continue
		ans[i] = 'Yes'
	return ans
print(*solve(), sep='\n')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if D < B or A < B:
		print('No')
		continue
	x = A - (A - C + B - 1) // B * B
	g = gcd(B, D)
	l = (C - x) % g
	if C - B + g - l >= 0:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	if d - b < 0:
		print('No')
		continue
	if a - b < 0:
		print('No')
		continue
	big = int(b)
	sml = int(d)
	while sml != 0:
		(big, sml) = (sml, big % sml)
	gcd = big
	r = (a - c - 1) % gcd + 1
	if r + c >= b:
		print('Yes')
	else:
		print('No')


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

def check(A, B, C, D):
	if A < B:
		return False
	if C < A % B:
		return False
	if D < B:
		return False
	x = gcd(B, D)
	return B <= C + x

def main():
	T = int(input())
	for _ in range(T):
		(A, B, C, D) = map(int, input().split())
		if check(A, B, C, D):
			print('Yes')
		else:
			print('No')
main()


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

def judge(A, B, C, D):
	if B > A or B > D:
		return False
	if B <= C:
		return True
	g = gcd(B, D)
	a = A % g
	return a - g < C + 1 - B
T = int(input())
for _ in range(T):
	bl = judge(*map(int, input().split()))
	print('Yes' if bl else 'No')


from fractions import *
(_, *t) = open(0)
for t in t:
	(a, b, c, d) = map(int, t.split())
	g = gcd(b, d)
	print('YNeos'[b > min(a, d) or b - g + a % g > c::2])


from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
	return int(input())

def reads():
	return [int(x) for x in input().split()]

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

def solve(A, B, C, D):
	if A < B or D < B:
		print('  V1', file=stderr)
		return False
	CC = C + 1
	if B <= CC:
		print('  V2', file=stderr)
		return True
	g = gcd(D, B)
	if CC <= B - g:
		print('  V3', file=stderr)
		return False
	else:
		print('  V4', file=stderr)
		return A % g < CC % g
T = read()
for _ in range(T):
	(A, B, C, D) = reads()
	print('Yes' if solve(A, B, C, D) else 'No')


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul
sys.setrecursionlimit(10000)

def read_int():
	return int(input())

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

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

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

def slv2(A, B, C, D):
	if A < B:
		return 'No'
	if D < B:
		return 'No'
	if C >= B:
		return 'Yes'
	g = gcd(B, D)
	if B - g + A % g > C:
		return 'No'
	return 'Yes'

@mt
def slv(T, Q):
	a = []
	for q in Q:
		a.append(slv2(*q))
	return '\n'.join(a)

def main():
	T = read_int()
	Q = [read_int_n() for _ in range(T)]
	print(slv(T, Q))
main()


def Yes():
	print('Yes')

def No():
	print('No')

def gcd(x, y):
	b = max(x, y)
	s = min(x, y)
	r = b % s
	while r != 0:
		b = s
		s = r
		r = b % s
	return s

def lcm(x, y):
	return x * y // gcd(x, y)

def main():
	T = int(input())
	AD = [list(map(int, input().split())) for i in range(T)]
	for i in AD:
		A = i[0]
		B = i[1]
		C = i[2]
		D = i[3]
		if A < B:
			No()
			continue
		if B > D:
			No()
			continue
		add = D - B
		d = gcd(B, D)
		C += 1
		t = C % d
		k = A % d
		if k == t:
			LD = C
		elif k > t:
			LD = C + k - t
		else:
			LD = C + d - t + k
		if LD < B:
			No()
		else:
			Yes()
main()


import sys

def gcd(x, y):
	(x, y) = sorted([x, y])
	while y % x:
		(y, x) = (x, y % x)
	return x
t = int(sys.stdin.readline())
for _ in range(t):
	(a, b, c, d) = map(int, sys.stdin.readline().split())
	if a < b:
		print('No')
	elif d < b:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		g = gcd(b, d)
		if b - g + a % g > c:
			print('No')
		else:
			print('Yes')


def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if D < B or A < B:
		print('No')
	else:
		g = egcd(B, D)[0]
		mA = A % g
		mC = C % g
		k = C + (mA - mC if mA - mC > 0 else mA - mC + g)
		k -= B
		if k >= 0:
			print('Yes')
		else:
			print('No')


T = int(input())

def gcd(m, n):
	r = m % n
	return gcd(n, r) if r else n

def check(a, b, c, d):
	if b > a or d < b:
		return 0
	g = gcd(b, d)
	k = (a - c - 1) // g
	p = a - k * g
	if p - b < 0:
		return 0
	return 1
for _ in range(T):
	(a, b, c, d) = map(int, input().split())
	print('Yes' if check(a, b, c, d) else 'No')


gcd = lambda x, y: x if y == 0 else gcd(y, x % y)
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	dx = d % b
	if a < b:
		print('No')
	elif d < b:
		print('No')
	elif c >= b:
		print('Yes')
	elif a % b > c:
		print('No')
	elif dx == 0:
		print('Yes')
	elif b - gcd(b, d) + a % gcd(b, d) > c:
		print('No')
	else:
		print('Yes')


from fractions import *
exec("a,b,c,d=map(int,input().split());g=gcd(b,d);print('YNeos'[b>min(a,d)or b-g+a%g>c::2]);" * int(input()))


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

def judge(a, b, c, d):
	if a < b or d < b:
		return False
	elif c >= b:
		return True
	else:
		g = findGCD(b, d)
		thr = b - g + a % g
		if thr > c:
			return False
		else:
			return True
T = int(input())
ABCD = []
for i in range(T):
	ABCD.append(list(map(int, input().split())))
for (a, b, c, d) in ABCD:
	if judge(a, b, c, d):
		print('Yes')
	else:
		print('No')


T = int(input())

def gcd(n, m):
	if m == 0:
		return n
	return gcd(m, n % m)
ans = []
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if A < B:
		ans.append('No')
		continue
	if B > D:
		ans.append('No')
		continue
	if C >= B:
		ans.append('Yes')
		continue
	G = gcd(D, B)
	maxMod = B - G + A % G
	if C < maxMod:
		ans.append('No')
	else:
		ans.append('Yes')
print(*ans, sep='\n')


t = int(input())
abcd = [tuple((int(x) for x in input().split())) for _ in range(t)]

def calc_gcd(x, y):
	if x < y:
		(x, y) = (y, x)
	if y == 0:
		return x
	z = x % y
	return calc_gcd(y, z)
for (a, b, c, d) in abcd:
	if b > a or b > d:
		print('No')
		continue
	elif c >= b:
		print('Yes')
		continue
	g = calc_gcd(b, d)
	if b - g + a % g > c:
		print('No')
	else:
		print('Yes')


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
t = int(input())
result = []
for i in range(t):
	(a, b, c, d) = list(map(int, input().split()))
	if b > d:
		result.append('No')
	elif a < b:
		result.append('No')
	elif a % b > c:
		result.append('No')
	elif b - c - 1 < gcd(b, d):
		result.append('Yes')
	else:
		result.append('No')
for r in result:
	print(r)


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

def solve(a, b, c, d):
	if a < b or d < b:
		return False
	if b < c:
		return True
	g = gcd(b, d)
	return b + a % g - g <= c
(T, *L) = map(int, open(0).read().split())
print('\n'.join(('Yes' if solve(*t) else 'No' for t in zip(*[iter(L)] * 4))))


def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
T = int(input())
for _ in range(T):
	(a, b, c, d) = map(int, input().split())
	if a < b or d < b:
		flag = False
	elif c >= b - 1:
		flag = True
	else:
		g = gcd(b, d)
		flag = b + a % g - g <= c
	if flag:
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for i in range(T):
	(A, B, C, D) = map(int, input().split())
	if B > D:
		print('No')
	elif A < B:
		print('No')
	elif C + 1 >= B:
		print('Yes')
	else:
		q = gcd(B, D)
		r = (A - C) % q
		if r == 0:
			r = q
		if C + r >= B:
			print('Yes')
		else:
			print('No')


from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
INF = float('inf')

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

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

def LS():
	return sys.stdin.readline().split()

def S():
	return sys.stdin.readline().strip()

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]

def SRL(n):
	return [list(S()) for i in range(n)]

def MSRL(n):
	return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
t = I()
for i in range(t):
	(a, b, c, d) = LI()
	g = gcd(b, d)
	if b > d or a < b:
		print('No')
	elif c >= b - 1:
		print('Yes')
	elif (a - (b - 1) - 1) // g != (a - (c + 1)) // g:
		print('No')
	else:
		print('Yes')


T = int(input())

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

def solve(A, B, C, D):
	if A < B:
		return False
	if D < B:
		return False
	if C >= B:
		return True
	s = A % B
	d = D % B
	n = B - C
	if d == 0:
		return s <= C
	else:
		g = gcd(d, B)
		n = (B - 1 - s) // g
		m = s + n * g
		return m <= C
ABCD = [[int(_) for _ in input().split()] for i in range(T)]
for (A, B, C, D) in ABCD:
	if solve(A, B, C, D):
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
Query = []
for i in range(T):
	Query.append(list(map(int, input().split())))
for i in range(T):
	while True:
		if Query[i][0] % Query[i][1] > Query[i][2] or Query[i][0] < Query[i][1] or Query[i][1] > Query[i][3]:
			print('No')
			break
		G = gcd(Query[i][1], Query[i][3])
		if Query[i][1] - G + Query[i][0] % G > Query[i][2]:
			print('No')
			break
		else:
			print('Yes')
			break


T = int(input())

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
for _ in range(T):
	(a, b, c, d) = list(map(int, input().split()))
	if a < b or d < b:
		print('No')
		continue
	a %= b
	d %= b
	d = gcd(d, b)
	if c >= b:
		print('Yes')
		continue
	x = (b - a) // d
	y = a + x * d
	if y == b:
		y -= d
	if y > c:
		print('No')
	else:
		print('Yes')


import sys
readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
	from math import gcd

	def judge(a, b, c, d):
		if a - b < 0:
			return False
		else:
			if d - b < 0:
				return False
			first = a - b
			l = c + 1
			r = b - 1
			x = gcd(b, d)
			mod_min = first + (first - l + x - 1) // x * x
			mod_max = first + (r - first) // x * x
			if l <= mod_min <= r or l <= mod_max <= r:
				return False
			else:
				return True
	T = int(readline())
	for _ in range(T):
		(a, b, c, d) = map(int, readline().split())
		print('Yes') if judge(a, b, c, d) else print('No')
main()


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

def inpl():
	return [int(i) for i in input().split()]
T = int(input())
for _ in range(T):
	(A, B, C, D) = inpl()
	if A < B or B > D:
		print('No')
		continue
	if C >= B:
		print('Yes')
		continue
	gcdbd = gcd(B, D)
	if (1 + (C - A % B) // gcdbd) * gcdbd + A % B >= B:
		print('Yes')
	else:
		print('No')


import sys
iT = int(input())
aR = [[int(x) for x in sLine.split()] for sLine in sys.stdin.readlines()]

def fGcd(iX, iY):
	while iY:
		(iX, iY) = (iY, iX % iY)
	return iX

def fFunc(iA, iB, iC, iD):
	if iA < iB or iD < iB:
		return False
	elif iC >= iB:
		return True
	elif iC < iA % iB:
		return False
	elif iB - iC - 1 < fGcd(iB, iD):
		return True
	else:
		return False
for eR in aR:
	if fFunc(*eR):
		print('Yes')
	else:
		print('No')


T = int(input())
ABCD = [[int(i) for i in input().split()] for _ in range(T)]

def gcd(a, b):
	(a, b) = (max(a, b), min(a, b))
	while b != 0:
		(a, b) = (b, a % b)
	return a

def solve(A, B, C, D):
	if B > A or B > D:
		return 'No'
	a0 = A % B
	d = gcd(B, D)
	if a0 + ((C - a0) // d + 1) * d >= B:
		return 'Yes'
	return 'No'
for (A, B, C, D) in ABCD:
	print(solve(A, B, C, D))


import math
t = int(input())
abcd = []
for i in range(t):
	abcd.append(list(map(int, input().split())))
for i in range(t):
	if abcd[i][0] < abcd[i][1]:
		print('No')
	elif abcd[i][1] > abcd[i][3]:
		print('No')
	elif abcd[i][3] % abcd[i][1] == 0:
		if abcd[i][0] % abcd[i][1] > abcd[i][2]:
			print('No')
		else:
			print('Yes')
	else:
		(big, small) = (abcd[i][1], abcd[i][3])
		while big % small:
			(big, small) = (small, big % small)
		gcd = small
		if abcd[i][1] - gcd <= abcd[i][2]:
			print('Yes')
		else:
			print('No')


from math import floor

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
T = int(input())
for i in range(T):
	(A, B, C, D) = map(int, input().split())
	if B > D or B > A:
		print('No')
	elif A % B > C:
		print('No')
	else:
		d = gcd(B, D % B)
		r = A % B % d
		if B - d + r > C:
			print('No')
		else:
			print('Yes')


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
t = int(input())
abcd = []
ans = 'No'
for i in range(0, t):
	ABCD = list(map(int, input().split()))
	abcd.append(ABCD)
for (a, b, c, d) in abcd:
	if a >= b and b == d and (b <= c):
		ans = 'Yes'
	if a >= b and d >= b and (b > c) and (b - gcd(d, b) + a % gcd(d, b) <= c):
		ans = 'Yes'
	if a >= b and d >= b and (b <= c):
		ans = 'Yes'
	print(ans)
	ans = 'No'


T = int(input())

def gcd(a: int, b: int) -> int:
	if a < b:
		(a, b) = (b, a)
	return a if b == 0 else gcd(b, a % b)

def lcm(a: int, b: int) -> int:
	return a // gcd(a, b) * b
for i in range(T):
	(A, B, C, D) = map(int, input().split(' '))
	g = gcd(B, D)
	if A < B or D < B:
		print('No')
		continue
	if C >= B - g + A % g:
		print('Yes')
	else:
		print('No')


def examA():
	N = I()
	A = LI()
	ans = 0
	for i in range(N - 1):
		if A[i + 1] == A[i]:
			A[i + 1] = 101
			ans += 1
	print(ans)
	return

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

def examB():
	T = I()
	for i in range(T):
		ans = 'Yes'
		(A, B, C, D) = LI()
		if A < B:
			ans = 'No'
		elif D < B:
			ans = 'No'
		elif C >= B:
			print(ans)
			continue
		elif B - C > gcd(D, B):
			ans = 'No'
		if A % B > C:
			ans = 'No'
		print(ans)
	return

def examC():
	N = I()
	S = SI()
	d1 = defaultdict(int)
	d2 = defaultdict(int)
	loop = 2 ** N
	for i in range(loop):
		curR = ''
		curB = ''
		curR2 = ''
		curB2 = ''
		for j in range(N):
			if i & 1 << j == 1 << j:
				curR += S[j]
				curR2 += S[j + N]
			else:
				curB += S[j]
				curB2 += S[j + N]
		d1[curR, curB] += 1
		d2[curR2, curB2] += 1
	ans = 0
	for (key, i) in d1.items():
		cur = i * d2[key[1][::-1], key[0][::-1]]
		ans += cur
	print(ans)
	return
import sys, copy, bisect, itertools, heapq, math
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque

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

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

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, inf
mod = 10 ** 9 + 7
inf = 10 ** 18
examB()


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	if A < B or D < B:
		print('No')
		continue
	elif C + 1 >= B:
		print('Yes')
		continue
	else:
		s_res = A % B
		s_k = int((C + 1 - s_res - 0.1) // B + 1)
		X = gcd(B, D % B)
		if X == 1:
			print('No')
			continue
		else:
			s_0 = s_k * B + s_res
			if (s_0 - (C + 1)) % X > B - C - 2:
				print('Yes')
			else:
				print('No')


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
for _ in range(n):
	(a, b, c, d) = map(int, input().split())
	if a < b or a % b > c or b > d:
		print('No')
	elif b == d:
		print('Yes')
	elif a % b + d == a:
		print('Yes')
	elif c + gcd(b, d) >= b:
		print('Yes')
	else:
		print('No')


def makelist(n, m):
	return [[0 for _ in range(m)] for _ in range(n)]

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
T = int(input())
for turn in range(1, T + 1):
	(init, sell, base, add) = map(int, input().split())
	hoge = gcd(sell, add)
	ans = 'Yes'
	if init < sell or sell > add:
		ans = 'No'
	elif base + hoge >= sell:
		if init % sell > base:
			ans = 'No'
	else:
		ans = 'No'
	print(ans)


t = int(input())
qs = [list(map(int, input().split())) for i in range(t)]

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def aprime(a, b, c, d):
	app = a % b
	return c + d - b - (c - app) % (d - b)

def ans(a, b, c, d):
	if d < b or a < b or (a % b > c and c < b):
		return 'No'
	elif b == d or c > b:
		return 'Yes'
	elif aprime(a, b, c, d) < b:
		return 'No'
	else:
		return ans2(aprime(a, b, c, d), b, c, d)

def ans2(a, b, c, d):
	b2 = b % (d - b)
	gcdbbd = abs(computeGCD(b2, b - d))
	aa = a - (a - c) // gcdbbd * gcdbbd
	if aa == c:
		aa = c + gcdbbd
	if aa >= b:
		return 'Yes'
	else:
		return 'No'
for q in qs:
	print(ans(*q))


import sys
input = sys.stdin.readline

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

def good(a, b, c, d):
	if b > a:
		return 0
	if b > d:
		return 0
	if b <= c:
		return 1
	a %= b
	d %= b
	g = gcd(b, d)
	a += (b - a - 1) // g * g
	return not c < a < b
for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	if good(a, b, c, d):
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
res_list = []
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	E = gcd(B, D)
	res = 'Yes'
	if A < B:
		res = 'No'
	if D < B:
		res = 'No'
	if C < B - E:
		res = 'No'
	F = A - (A - C - 1) // B * B - B
	if F < 0:
		res = 'No'
	res_list.append(res)
for i in range(T):
	print(res_list[i])


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
(_, *Q) = map(int, open(0).read().split())
for (a, b, c, d) in zip(*[iter(Q)] * 4):
	if a < b or d < b:
		print('No')
		continue
	if c >= b:
		print('Yes')
		continue
	a %= b
	g = gcd(b, d)
	if b - g + a - g * (a // g) > c:
		print('No')
	else:
		print('Yes')


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

def f(a, b, c, d):
	yes = 'Yes'
	no = 'No'
	if a < b or d < b:
		return no
	if c >= b or a <= c:
		return yes
	if (a - c) % b > 0 and (a - c) % b < b - c:
		return no
	e = d % b
	if e == 0 or b - c == 1:
		return yes
	if e == 1:
		return no
	h = g(b, e)
	if h < b - c:
		return no
	if (a - c) % h > 0 and (a - c) % h < b - c:
		return no
	return yes
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	ans = f(a, b, c, d)
	print(ans)


import math

def solve(A, B, C, D):
	if A < B or A % B > C:
		return 'No'
	if D < B:
		return 'No'
	if D == B:
		return 'Yes'
	if B <= C + 1:
		return 'Yes'
	g = math.gcd(B, D)
	n = (B - 1 - A % B) // g
	s = A % B + n * g
	if C + 1 <= s <= B - 1:
		return 'No'
	return 'Yes'

def main():
	T = int(input())
	ans = list()
	for _ in range(T):
		(A, B, C, D) = map(int, input().split())
		ans.append(solve(A, B, C, D))
	for a in ans:
		print(a)
main()


def gcd(a, b):
	(a, b) = (max(a, b), min(a, b))
	while a % b != 0:
		(a, b) = (b, a % b)
	return b
T = int(input())
set = []
for i in range(T):
	set.append([int(j) for j in input().split()])
for i in range(T):
	if set[i][0] < set[i][1] or set[i][1] > set[i][3]:
		print('No')
	elif set[i][2] >= set[i][1]:
		print('Yes')
	else:
		g = gcd(set[i][1], set[i][3])
		amodg = set[i][0] % g
		if set[i][1] - g + amodg <= set[i][2]:
			print('Yes')
		else:
			print('No')


def gcd(X0, X1):
	Y0 = max([X0, X1])
	Y1 = min([X0, X1])
	if Y0 % Y1 == 0:
		return Y1
	else:
		return gcd(Y1, Y0 % Y1)

def canbuy(A, B, C, D):
	if B > A:
		return False
	elif B > D:
		return False
	elif C >= B:
		return True
	else:
		g = gcd(B, D)
		X = B - g + A % g
		if X > C:
			return False
		else:
			return True
T = int(input())
S = ['' for i in range(T)]
for i in range(T):
	(a, b, c, d) = map(int, input().split())
	if canbuy(a, b, c, d):
		S[i] = 'Yes'
	else:
		S[i] = 'No'
for i in range(T):
	print(S[i])


import math
N = int(input())
for i in range(N):
	(A, B, C, D) = map(int, input().split())
	if A < B:
		print('No')
		continue
	if B > D:
		print('No')
		continue
	if A % B > C:
		print('No')
		continue
	cycle = D - B
	GCD = math.gcd(B, cycle)
	if GCD == 1 and B - 1 > C:
		print('No')
		continue
	if B - GCD > C:
		print('No')
		continue
	print('Yes')


t = int(input())
query = [tuple(map(int, input().split())) for _ in range(t)]

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
for (a, b, c, d) in query:
	g = gcd(b, d)
	r = a % g
	m = ((c - r) // g + 1) * g
	if b <= m and b <= a and (b <= d):
		print('Yes')
	else:
		print('No')


def gcd(x, y):
	if x < y:
		tmp = y
		y = x
		x = tmp
	while x % y != 0:
		r = x % y
		x = y
		y = r
	return y
n = int(input())
x = []
for i in range(n):
	(a, b, c, d) = map(int, input().split())
	x.append((a, b, c, d))

def f(a, b, c, d):
	if a < b:
		print('No')
	elif b > d:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		g = gcd(b, d)
		if b - g + a % g > c:
			print('No')
		else:
			print('Yes')
for i in range(n):
	(a, b, c, d) = (x[i][0], x[i][1], x[i][2], x[i][3])
	f(a, b, c, d)


from math import gcd

def solve(a, b, c, d):
	if a < b:
		return False
	if d < b:
		return False
	g = gcd(b, d)
	m = b - (b - a - 1) % g - 1
	return m <= c
T = int(input())
for _ in range(T):
	print('Yes' if solve(*map(int, input().split())) else 'No')


T = int(input())
query = [list(map(int, input().split())) for i in range(T)]

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
ans_list = []
for i in range(T):
	A = query[i][0]
	B = query[i][1]
	C = query[i][2]
	D = query[i][3]
	if A < B:
		ans_list.append('No')
		continue
	if B > D:
		ans_list.append('No')
		continue
	if C >= B:
		ans_list.append('Yes')
		continue
	g = gcd(B, D)
	max_modB = B - g + A % g
	if max_modB > C:
		ans_list.append('No')
	else:
		ans_list.append('Yes')
print('\n'.join(ans_list))


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
for _ in range(int(input())):
	(a, b, c, d) = [int(x) for x in input().split()]
	if a < b:
		print('No')
		continue
	if d < b:
		print('No')
		continue
	if b <= c:
		print('Yes')
		continue
	g = gcd(b, d)
	if c >= b - g + a % g:
		print('Yes')
	else:
		print('No')


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

def solve(a, b, c, d):
	if a < b or d < b:
		return False
	if b < c:
		return True
	g = gcd(b, d)
	return b + a % g - g <= c
t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	if solve(a, b, c, d):
		print('Yes')
	else:
		print('No')


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
T = int(input())
Juice = [None] * T
for i in range(T):
	Juice[i] = list(map(int, input().split()))

def juicecheck(i):
	A = Juice[i][0]
	B = Juice[i][1]
	C = Juice[i][2]
	D = Juice[i][3]
	if A < B:
		print('No')
		return
	elif B > D:
		print('No')
		return
	elif B - 1 <= C:
		print('Yes')
		return
	else:
		x = A % B
		y = D % B
		z = gcd(B, D)
		if z == 1 or B - (C + 1) >= z or (C + 1) % z <= x % z <= (B - 1) % z or ((C + 1) % z > B % z and ((C + 1) % z <= x % z or x % z < B % z)):
			print('No')
			return
		print('Yes')
		return
for i in range(T):
	juicecheck(i)


T = int(input())
ABCD = []
for i in range(T):
	(a, b, c, d) = map(int, input().split())
	ABCD.append((a, b, c, d))
for abcd in ABCD:
	(a, b, c, d) = abcd
	if a < b:
		print('No')
	elif d < b:
		print('No')
	elif c >= b:
		print('Yes')
	else:
		e = a % b
		f = d % b
		list = [a]
		if f == 0:
			if c < e < b:
				print('No')
			else:
				print('Yes')
		else:
			cnt = 0
			while cnt < 100:
				g = ((c - e) // f + 1) * f + e
				if g < b:
					print('No')
					cnt += 10000
				elif g in list:
					print('Yes')
					cnt += 10000
				else:
					list.append(g)
					a = g
					e = a % b
					f = d % b
					cnt += 1