t = int(input())
for i in range(t):
    a, b, c, d = map(int, input().split())
    prev = []
    while True:
        if a < b:
            print('No')
            break
        a %= b
        if a in prev:
            print('Yes')
            break
        elif c >= a:
            prev.append(a)
            a += d
        else:
            print('No')
            break
