t=int(input())
for i in range(t):
    a,b,c,d = list(map(int,input().split()))
    st = []
    if a-b > c:
        a = a%b
        while a<=c:
            a+=b
    if d-b>c:
        d = d%b
        while d<=c:
            d+=b

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