#
import sys
import math
import numpy as np
import itertools

n = int(input())
a=[]
b=[]
c=[]
d=[]
for j in range(0,n):
    t1,t2,t3,t4 = (int(i) for i in input().split())  
    a.append(t1)
    b.append(t2)
    c.append(t3)
    d.append(t4)
    
for i in range(0,n):
    if a[i] < b[i]:
        print("No")
    elif d[i] < b[i]:
        print("No")
    else:
        flag=1
        for j in range(0,b[i]):
            p= (a[i]+j*d[i]) % b[i]
            if p > c[i] and p != 0 :
                flag=0
        if flag == 1:
            print("Yes")
        else:
            print("No")
    
