t=int(input())
for _ in range(t):
    a,b,c,d=map(int,input().split())
    e=b*(max((a-c)//b,1))
    a-=e
    while a>c:
        a-=b
    if a<0:
        print('No')
        continue
    if d<b:
        print('No')
        continue
    if c<=b and d>b:
        """
        while a<=c:
            a+=(d-b)
        """
        a+=(d-b)*(min(0,c//(d-b)-10000))
        while a<=c:
            a+=(d-b)
        while a-(d-b)>c:
            a-=(d-b)
        if a<b:
            print('No')
            continue
    print('Yes')