t=int(input())
for i in range(t):
    a,b,c,d=map(int,input().split())
    if a<b:
        print('No')
    else:
        aa=a
        flag=0
        cnt=(aa-c)//b
        aa=aa-b*(cnt-1)
        while flag==0:
            aa=aa-b
            if aa>c and aa<b:
                flag+=1
            elif aa>c:
                pass
            else:
                aa+=d
                if aa==a:
                    flag=flag-1
                else:
                    pass
        if flag==1:
            print('No')
        else:
            print('Yes')