def sarch2(a, b, c, d):
    key = d - b
    fst = snd = trd = fth = fith = 0
    if a - b > b:
        a -= b * int(a / b)
        a += b
    while True:
        if a == fst or a == snd or a == trd or a == fth or a == fith:
            return "Yes"
        fith = fth
        fth = trd
        trd = snd
        snd = fst
        fst = a
        
        if a - b > b:
            a -= b * int(a / b)
            a += b
        
        if a - b > c:
            break

        if a - b > b:
            a -= b * int(a / b)
            a += b

        a += key
        

        
    if a - 2 * b >= 0:
        return "Yes"
    else:
        return "No"

       
N = int(input())
data = []
for i in range(N):
    A, B, C, D = map(int, input().split())
    if A < B or B > D:
        print("No")
    else:
        print(sarch2(A, B, C, D))