t = int(input())
a = []
b = []
c = []
d = []
for i in range(t):
    tmp = list(map(int, input().split(" ")))
    a.append(tmp[0])
    b.append(tmp[1])
    c.append(tmp[2])
    d.append(tmp[3])

for i in range(t):
    if(a[i] < b[i]): print("No")
    elif(b[i] > d[i]): print("No")
    elif(b[i] <= c[i]): print("Yes")
    else:
        remain = a[i] - (a[i] // b[i]) * b[i]
        increase = d[i] - b[i]
        if(increase == 0):
            if(c[i] >= remain): print("Yes")
            elif(b[i] > remain): print("No")
            else: print("Yes")
        else:
            if(c[i] >= remain): remain += ((c[i] - remain) // increase) * increase
            if(c[i] >= remain): remain += increase
            if(remain < b[i]):
                print("No")
                continue

            history = [remain]
            remain -= b[i]
            if(c[i] >= remain): remain += ((c[i] - remain) // increase) * increase
            if(c[i] >= remain): remain += increase
            if(remain < b[i]):
                print("No")
                continue
            
            history.append(remain)
            sa = history[1] - history[0]
            if(sa <= 0):
                print("Yes")
                continue
            remain -= ((remain - c[i]) // sa) * sa
            if(c[i] >= remain): remain += sa
            if(remain < b[i]):
                print("No")
            else: print("Yes")