#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import ceil, floor

def solve():
    n = int(input())
    ans = []
    for i in range(n):
        l = []
        a, b, c, d = map(int, input().split())
        while True:
            if a <= c:
                t = a - b
                if t < 0:
                    ans.append('No')
                    break
                l.append(t)
                a = t + d
                continue
            f = ceil((a / b) - (c / b))
            if f <= 0:
                ans.append('No')
                break
            t = a - b * f
            while t > c:
                t -= b
            if l.count(t) > 2:
                ans.append('Yes')
                break
            if t < 0:
                ans.append('No')
                break
            l.append(t)
            a = t + d
    print('\n'.join(ans))

if __name__=="__main__":
    solve()