
N = int(input())

for i in range(N):
    a,b,c,d = map(int,input().split( ))
    if a < b:
        print("No")
    elif b == 1:
        print("Yes")
    else:
        a = a % b
        while a <= c:
            a += b
#        d = d % b
#        while d <= c:
#            d += b
        ok = False
        store = a
        for i in range(a):
            store += -b
            if store < 0:
                break
            if store <= c:
                store += d
            if store == a:
                ok = True
                break
        if ok :
            print("Yes")
        else:
            print("No")
