#!py2
from fractions import gcd

def solve(initial, burn, check, resupply):
    if burn > initial or burn > resupply:
        return False
    if check >= burn:
        return True

    x = initial % burn
    g = gcd(resupply, burn)
    
    # k largest with x + k*g < burn, then decide if x + k*g <= check
    k = (burn - x) // g
    if k * g + x == burn: k -= 1
    return x + k * g <= check

for _ in xrange(int(raw_input())):
    print "Yes" if solve(*map(int, raw_input().split())) else "No"
