t=int(input())
abcd=[list(map(int, input().split())) for _ in range(t)]
a=[abcd[i][0] for i in range(t)]
b=[abcd[i][1] for i in range(t)]
c=[abcd[i][2] for i in range(t)]
d=[abcd[i][3] for i in range(t)]
for i in range(t):
    if b[i]>d[i] or b[i]>a[i]:#簡単な破綻
        j='No'
    elif b[i]==d[i]:
        if ((a[i]-b[i])%d[i])>c[i] and ((a[i]-b[i])%d[i])<b[i]:
            j='No'
        else:
            j='Yes'
    else:
        if abs(2*b[i]-a[i])%(d[i]-b[i])==0:
            t=b[i]-abs(2*b[i]-a[i])%(d[i]-b[i])-(d[i]-b[i])
        else:
            t=b[i]-abs(2*b[i]-a[i])%(d[i]-b[i])
        if t>c[i]:
            j='No'
        else:
            j='Yes'    
    print(j)