T = int(input())
A,B,C,D=[0]*T,[0]*T,[0]*T,[0]*T
for i in range(T):
    A[i],B[i],C[i],D[i]=map(int,input().split())
ans = 'Yes'
inpval = [A,B,C,D]
[a,b,c,d]=[list(filter(lambda x:1<=x<=10**18,y)) for y in inpval]

if ((1<=T<=300)
and(len(a)==len(b)==len(c)==len(d)==T)):
    
    for i in range(T):
        if (A[i] < B[i]):
            ans = 'No'
        elif (B[i] > D[i]):
            ans = 'No'
        elif (C[i]>=B[i]):
            ans = 'Yes'
        else:
            for j in range(B[i]):
                A[i] = (A[i]+D[i])%B[i]
                #A[i] += D[i]
                if (A[i] > C[i]-1):    
                #if ((A[i]%B[i])>C[i])and((A[i]%B[i])!=C[i]):
                    print(A[i],B[i],C[i],D[i])
                    ans = 'No'
                    break
        print(ans)