t=int(input())
for i in range(t):
    a,b,c,d = list(map(int,input().split()))
    st = []
    if a-b > 0 and c>=b and d >=b:
        print('Yes')
        continue
        
    if a > c*100:    
        if a-b > c:
            a = a%b
            while a<=c:
                a+=b
    if d > c*100:
        if d-b>c:
            d = d%b
            while d<=c:
                d+=b

    while True:
        if a-b < 0:
            print('No')
            break
        
        a -= b
        if a <= c:
            a += d
        if a in st:
            print('Yes')
            break
        st.append(a)

