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