from sys import stdin, stdout

t = int(stdin.readline())
for i in range(t):
    a, b, c, d = map(int, stdin.readline().split())
    
    if d < b:
        stdout.write('No\n')
        continue
    
    l, r = 0, a + 1
    while r - l > 1:
        m = (l + r) >> 1
        
        if a - m * b > c:
            l = m
        else:
            r = m
    
    if a - r * b < 0:
        stdout.write('No\n')
        continue
    
    cur = a - r * b
    
    if d == b:
        stdout.write('Yes\n')
        continue
    
    for j in range(10000):
        cur = cur + (d - b) * ((c + 1 - cur + (d - b - 1)) // (d - b))
        cur -= b
        
        if cur < 0:
            stdout.write('No\n')
            break
    else:
        stdout.write('Yes\n')