# -*- coding: utf-8 -*-
from itertools import combinations
def inpl(): return map(int, input().split())

N = int(input())
for _ in range(N):
    A, B, C, D = inpl()
    if A < B:
        print("No")
        continue

    A = A + ((C-A)//B)*B

    if A < 0:
        print("No")
        continue

    E = D-B
    if E < 0:
        print("No")
        continue
    if E == 0:
        print("Yes")
        continue
    A = A%E
    assert 0 <= (A + (B-1-A)//E*E)%B < B
    print("No" if (A + (B-1-A)//E*E)%B > C else "Yes")