from collections import*
t=int(input())

def loop(a,b,c,d):
    if a>100000:
        l=deque([a%b+3*b])
    else:
        l=deque([a])
    while True:
        if l[-1]>=b:
            l.append(l[-1]-b)
        else:
            return "No"
        if l[-1]<=c:
            l.append(l[-1]+d)
        if len(l)>1000:
            return "Yes"
            break
    

for i in range(t):
    a,b,c,d=map(int,input().split())
    print(loop(a,b,c,d))