#!/usr/bin/env python
def solve():
    a, b, c, d = map(int, input().split())
    if a < b or d < b:
        return 'No'
    cache = set()
    while True:
        a %= b
        if c < a < d:
            return 'No'
        a += (d - b)
        if a in cache:
            return 'Yes'
        cache.add(a)

T = int(input())
for _ in range(T):
    print(solve())