T = int(input())
for _ in range(T):
    A, B, C, D = map(int, input().split())
    if B>D:
        print('No')
        continue
    pre = set()
    if A//B>0:
        A = A%B
        A += B
    if D//B>0:
        D = D%B
        D += B
    pre.add(A)
    while 1:
        A = A-B
        if A < 0:
            print('No')
            break
        if  A <= C:
            A += D
        if A in pre:
            print('Yes')
            break
        pre.add(A)