T=int(input())
for _ in range(T):
    a,b,c,d=map(int, input().split())
    A=[]
    while True:
        if a<b or b>d or a%b>c: 
            print("No")
            break
        elif b<=c+1 or b==d or a in A or len(A)==100:
            print("Yes")
            break
        else:
            if int((b+c-a)/(d-b)) != int((2*b-a)/(d-b)):
                print("No")
                break
            else:
                A.append(a)
                a = (int((2*b-a)/(d-b))+1)*(d-b)+a-b