import numpy as np
import math
from copy import deepcopy

ans=("")
t=int(input())
h=[]
for i in range(t):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(t):
    a=h[i][0]
    b=h[i][1]
    c=h[i][2]
    d=h[i][3]
    f=a-b
    if(f<0):
        print("No")
        continue
    if(b==d):
        if(f>c):print("No")
        else:print("Yes")
        continue
    if(d-b==c):
        print("Yes")
        continue
    if(d-b>c):
        if(a-d<=c):
            print("Yes")
            continue
        else:
            print("No")
            continue   
    if(d-b<0):
        print("No")
        continue  
    e=int(math.ceil((b-f)/(d-b)))
    f+=(e-1)*(d-b)
    if(f<=c):ans=("Yes")
    else:ans=("No")
    print(ans)
    continue