T = int(input())
for _ in range(T):
    A,B,C,D = map(int, input().split())
    if B > D or B > A:
        ans = "No"
    elif B <= C+1:
        ans = "Yes"
    elif B == D:
        A %= B
        if C < A < B:
            ans = "No"
        else:
            ans = "Yes"
    else:
        x = (A-C-1)//B
        A -= x*B
        y = int((B+C-A)/(D-B))+1
        A += y*(D-B)-B
        z = max(int((B+C-A)/(D-B))+1, 1)
        if A >= B and z*(D-B) >= B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans)