n=int(input())
t=[list(map(int,input().split()))for i in range(n)]
for i in range(len(t)):
    x=t[i]
    b=x[0]%x[1]
    g=False
    if x[1]>x[3] or x[0]<x[1]:print("No");continue
    while 1:
        if x[0]<x[1]:print("No");break
        x[0]%=x[1]
        if x[0]==b and g:print("Yes");break
        g=True
        if x[0]<=x[2]:x[0]+=x[3]