T=int(input().strip())
ABCD= [list(map(int, input().split())) for i in range(T)]
ans="No Yes".split()
for A,B,C,D in ABCD:
    if A<B or D<B:
        print("No")
        continue
    if B<=C:
        print("Yes")
        continue
    # B<=A, B<=D, B>C
    rest=set()
    while True:
        if A<B:
            print("No")
            break
        A=A%B
        if A in rest:
            print("Yes")
            break
        rest.add(A)
        if A<=C:
            A+=D