T = int(input())

for i in range(T):
    a, b, c, d = map(int, input().split())
    used = []
    while True:
        if a < b:
            end = False
            break
        else:
            a %= b
            if a <= c:
                
                if a not in used:
                    used.append(a)
                else:
                    end = True
                    break
                a += d
                
            else:
                if a not in used:
                    used.append(a)
                else:
                    end = True
                    break
    
    if end:
        print('Yes')
    else:
        print('No')   