def result(a, b, c, d):
    if a < b or d < b or a % b > c:
        return 'No'
    delta = d % b
    if c > b or delta == 0:
        return 'Yes'
    start = a % b
    while start >= d:
        start -= b
    current = start
    while True:
        current += delta
        if current > c:
            current = min(current % b, current-b)
            if current < 0:
                return 'No'
        if current == start:
            return 'Yes'


T = int(input())
for _ in range(T):
    a, b, c, d = map(int, input().split())
    print(result(a, b, c, d))
