T = int(input())
for i in range(T):
    A, B, C, D = map(int, input().split())
    if A < B:
        print('No')
        continue
    if B > D:
        print('No')
        continue
    if C >= B - 1:
        print('Yes')
        continue
    A = A % B
    D = D % B
    first_A = A
    while True:
        if A > C:
            print('No')
            break
        A = (A + D) % B
        if A == first_A:
            print('Yes')
            break
