import math
def LI(): return list(map(int, input().split()))

def check(a, b, c, d):
    if a < b or b > d:
        return False
    if c >= b:
        return True
    k = math.ceil((a-c)/b)
    k = (a-c)//b
    #print(k)
    #print((a-c)//b)
    #print(a)
    #print(k*b)
    first = a - k*b
    if first > c:
        first -= b
    #print(first)
    if first < 0:
        #print("c")
        return False
    sub = d%b
    if sub == 0:
        #print("d")
        return True
    first = first % sub
    s = set([first])
    while True:
        n = int(((c-first)/sub)) + 1
        next_first = (first + n*sub - b)
        if next_first < 0:
            return False
        next_first = next_first % sub
        if next_first in s:
            #print("e")
            return True
        s.add(next_first)
        first = next_first


t = int(input())
q = []
for i in range(t):
    a, b, c, d = LI()
    q.append(check(a,b,c,d))
for i in q:
    if i:
        print("Yes")
    else:
        print("No")