import numpy as np
t = int(input())
a = []
b = []
c = []
d = []
for k in range(t):
    aa,bb,cc,dd = list(map(int,input().split()))
    a.append(aa)
    b.append(bb)
    c.append(cc)
    d.append(dd)

aa = a
bb = b
cc = c
dd = d

def check(a,b,c,d):
    if a < b:
        ans = 'No'
        return ans
    if b > d:
        ans = 'No'
        return ans
    else:
        if c >= b:
            ans = 'Yes'
            return ans
    ans = 'Yes'
    rec = []
    for k in range(100):
        temp = int(np.mod(a + k * d,b))
        if temp > c:
            ans = 'No'
            break
        if temp in rec:
            break
        rec.append(temp)
    return ans

for a,b,c,d in zip(aa,bb,cc,dd):
    print(check(a,b,c,d))