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 b != d and b > c:
        if (b - c) > (d - b):
            cond = False
        else:
            tmp = (((c - (a % b)) // (d - b)) + 1) * (d - b) +  (a % b)
            if tmp > c:
                cond = False
        
    if cond:
        print('Yes')
    else:
        print('No')