import math
def LI(): return list(map(int, input().split()))
t = int(input())
q = []
for i in range(t):
    a, b, c, d = LI()
    if a < b or b > d:
        print("No")
        continue
    if c >= b:
        print("Yes")
        continue
    k = math.ceil((a-c)/b)
    k = (a-c)//b
    first = a - k*b
    if first > c:
        first -= b
    if first < 0:
        print("No")
        continue
    sub = d%b
    if sub == 0:
        print("Yes")
        continue
    first = first % sub
    s = set([first])
    while True:
        n = int(((c-first)/sub)) + 1
        next_first = (first + n*sub - b)
        if next_first < 0:
            print("No")
            break
        next_first = next_first % sub
        if next_first in s:
            print("Yes")
            break
        s.add(next_first)
        first = next_first


