t = int(input())
A = [list(map(int, input().split())) for _ in range(t)]
for i in range(t):
    state = True
    a,b,c,d = A[i]
    keep = []
    keep.append(a)
    if a < b:
        state = False
    else:
        a -= b
        if a <= c:
            a += d
        keep.append(a)
        while True:
            if a < b:
                state = False
                break
            a -= b
            if a <= c:
                a += d
            if a in keep:
                if keep[keep.index(a)-1] == keep[-1]:
                    break
            keep.append(a)
    if state:
        print('Yes')
    else:
        print('No')
