t = int(input())
abcd_list = [[int(i) for i in input().split()] for _ in range(t)]

for i in range(len(abcd_list)):
    a, b, c, d = abcd_list[i]
    _a = a
    is_ok = True
    for j in range(10000000):
        if d < b:
            is_ok = False
            break
        
        if _a - b > c:
            _a = _a - (((_a - c) // b) - 1) * b
        _a = _a - b
        if _a < 0:
            is_ok = False
            break
        if _a <= c:
            _a += d
    if is_ok:
        print("Yes")
    else:
        print("No")
