t = int(input())

def no():
    print("No")

def yes():
    print("Yes")

for i in range(t):
    a, b, c, d = map(int, input().split(" "))

    dif = d - b
    min_n = a - b

    if (a < b or d < b or a % b > c):
        no()
        continue
    if dif != 0 and min_n != 0 and b > c:
        already = []
        start = a
        done = False
        while True:
            count = start // b
            end = start - count * b
            if end in already:
                break
            if b > end > c:
                no()
                done = True
                break
            already.append(end)
            start = end + d
        if done:
            continue

    yes()