T = int(input())

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


for A,B,C,D in ABCD:
    
    if A < B:
        #print("AB")
        print("No")
        continue
    
    if C >= B and B <= D:
        #print("CB")
        print("Yes")
        continue

    #a = (A-C)%B
    a = (((A - C)//B+1)*B - (A-C))%B

    l = []
    while True:
        #print(a)
        if a > C:
            print("No")
            break
        if (D-a)//B > 1:
            a = (D-a)%B
        else:
            a = B - (D-a)
            if a<0:
                a+=B
#        a = ((D-a)//B+1)*B - (D-a)
        if a in l:
            print("Yes")
            break
        l.append(a)
