from math import ceil
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 D == B:
        if A <= B + C:
            print("Yes")
        else:
            print("No")
        continue

    X = ceil((B+C-A) / (D-B))
    Y = A + (D-B) * (X + (1 if X == (B+C-A) // (D-B) else 0))
    Z = Y - B
    #print(X, X == (B+C-A) // (D-B), Y)
    if Z > C:
        if Z < B:
            print("No")
        else:
            print("Yes")
    else:
        if X == (B+C-A) // (D-B):
            print("Yes")
        else:
            print("No")