t = int(input())

for _ in range(t):
    a, b, c, d = map(int, input().split())
    cond = True
    
    if a < b or b > d or (a % b) > c:
        cond = False
        
    if cond:
        if b < d and b > (c + 1):
            coef = ((c - (a % b)) // (d - b)) + 1
            tmp = (a % b) + coef * (d - b)
            if tmp > c and tmp < b:
                cond = False
    
    if cond:
        print('Yes')
    else:
        print('No')