#!/usr/bin/env python
import math
def solve():
    a, b, c, d = map(int, input().split())
    # 自明
    if d < b or a < b:
        return 'No'
    if c > b:
        return 'Yes'
    a %= b
    if a > c:
        return 'No'
    if d-b == 0:
        return 'Yes'
    cache = set([a])
    while True:
        t = ((c-a)//(d-b)+1)*(d-b)+a
        if c < t < b:
            return 'No'
        a = t % b
        if a in cache:
            return 'Yes'
        else:
            cache.add(a)

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