T = int(input())

for i in range(T) :
    A,B,C,D = map(int,input().split())
    
    Q = A%B
    R = (C-Q)%(D-B)
    
    
    if A-B <= 0 :
        print("No")
    elif B <= C :
        print("Yes")
    elif C+R == C :
        if C+D < B :
            print("No")
        else :
            print("Yes")
    elif C+R <B :
        print("No")
    else :
        print("Yes")
