t = int(input())
for i in range(t):
    a, b, c, d = map(int, input().split())
    if a < b:
        print('No')
    elif b > d:
        print('No')
    elif b == d:
        print('Yes' if a % b <= c else 'No')
    elif b < d:
        p = max(1, (a - c + b - 1) // b)
        q = a - p * b
        x = c - q
        y = d - b
        n = x // y + 1
        m = (a - b) + n * (d - b)
        if q < 0 or x < 0 or m < b:
            print('No')
        else:
            print('Yes')