import sys
sys.setrecursionlimit(10**6)
t = int(input())
for _ in range(t):
    a,b,c,d = map(int,input().split())

    if a < b or b > d:
        print("No")
        continue
    if b == d:
        if c >= a:
            print("Yes")
        elif a - ((a-c-1)//b+1)*b < 0:
            print("No")
        else:
            print("Yes")
        continue
    if c >= b:
        print("Yes")
        continue

    count = 0
    s = set()
    check = True
    while count < 3*10**5:
        x = max((a-c-1)//b,0)+1
        a -= x*b
        if a < 0:
            check = False
            break
        if a in s:
            break
        s.add(a)
        a += d
        count += 1
    if check and count < 3*10**5:
        print("Yes")
    else:
        print("No")
