from fractions import gcd

T = int(input())

OUTPUT = []
for t in range(T):
    A,B,C,D = map(int,input().split())
    if A//B>=1 and D-B>=0:
        if C>=B:
            OUTPUT.append("Yes")
        else:
            DIFF = gcd(D-B,B)
            START = (A%B-min([B,C]))
            START = START%DIFF if START>=0 else (START%DIFF)*(-1)
            K = (DIFF%B)+START
            if B-min([B,C]) > K and K > C-min([B,C]):
                OUTPUT.append("No")
            else:
                OUTPUT.append("Yes")
    else:
        OUTPUT.append("No")
    
for o in OUTPUT:
    print(o)