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("No")
        continue
    
    if C > B:
        print("Yes")
        continue

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

    dif = (D-B)%B

    if dif == 0:
        print("Yes")
        continue

    if dif>0:
        l=[]
        while True:
            
            a+=dif
            if C<a and a<B:
                print("No")
                break
            if a in l:
                print("Yes")
                break
            while a > C:
                a -= B
            l.append(a)
    else:
        a += B
        l=[]
        while True:
            a-=dif
            if C<a and a<B:
                print("No")
                break
            if a in l:
                print("Yes")
                break
            while a > C:
                a -= B
            l.append(a)
    

        


    
        

