#!/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())
        if a <= c:
            if a < b:
                ans.append('No')
                continue
            a = (a - b) + d + ceil(((a - b) + d) / c)
        while True:
            f = ceil((a / b) - (c / b))
            if f <= 0:
                ans.append('No')
                break
            t = a - b * f
            if t > c:
                ff = ceil((t / b) - (c / b))
                t = t - b * ff
            if t in l:
                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()