#B
T=int(input())
for i in range(T):
    A,B,C,D=map(int,input().split())
    A_list=[]
    while True:
        A-=B
        if A<0:
            print('No')
            break
        elif A<=C:
            A+=D
            if A in A_list:
                print('Yes')
                break
            A_list.append(A)