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:
        done = False
        start = (c-min_n) // dif
        for i in range(min_n + start*dif, b, dif):
            if b > i > c:
                no()
                done = True
                break
        if done:
            continue
    yes()