# B - rng_10s
# https://beta.atcoder.jp/contests/agc026/tasks/agc026_b

# B_rng_10s.py

T = int(input())


for i in range(T):
    result = "Yes"
    a,b,c,d = map(int, input().strip().split(" "))


    left = a
    appeared = [a]

    if a < b:
        result = "No"
    if a % b > c:
        result = "No"
    else:
        left -= b
    while left%b not in appeared[:len(appeared)-1]:
        if left % b > c:
            result = "No"
            break
        else:
            left = left % b
            if left <= c:
                appeared.append(left)
                left += d
                appeared.append(left)
                if left < b:
                    result = "No"
                    break
            appeared.append(left)

    print(result)
