# -*- coding : utf-8 -*-

T = int(input())

for t in range(T):
    A,B,C,D = map(int, input().split())
    stock = A
    past = [stock,]
    while True:
        if stock < B:
            print("No")
            break
        stock = stock - B + D * (stock - B <=C)
        if stock in past:
            print("Yes")
            break
        past.append(stock)
    