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:
        ans = "Yes"
        for _ in range(10000):
            x = max(0, (B+C-A)//(D-B)+1)
            A += x*(D-B)
            y = max(0, (A-C+B-1)//B-1)
            A -= y*B
            if A < B:
                ans = "No"
                break
    print(ans)