import numpy as np

N = int(input())
a = [list(map(int, input().split())) for _ in range(N)]

a_ = np.array(a)

def checking(A,B,C,D):
    X = A
    Y = A

    while X >= B:
        Y = X - B
        if Y <= C:
            X = Y + D
        else:
            X = Y

        if X == A:
            res = "Yes"
            break

    if X<=B:
        res = "No"

    return res

for s in range(N):
    A_ = a_[s,0]
    B_ = a_[s,1]
    C_ = a_[s,2]
    D_ = a_[s,3]
    result = checking(A_, B_ , C_ , D_)
    print(result)