N=int(input())
for i in range(N):
    L=input()
    L=L.rstrip().split(" ")
    A=int(L[0])
    B=int(L[1])
    C=int(L[2])
    D=int(L[3])
    
    if  A-B<0:
        print("No")
    elif D<B:
        print("No")
    elif D%B==0:
        if A%B<=C:
            print("Yes")
        else:
            print("No")
    else:
        MIN=int((C-A%B)/(D%B)+1)
        if int((B-A%B)/(D%B))==(B-A%B)/(D%B):
            MAX=int((B-A%B)/(D%B)-1)
        else:
            MAX=int((B-A%B)/(D%B))
        if MIN<=MAX:
            print("No")
        else:
            print("Yes")