n = int(input())
grid =[]

def checktrue(a, b, c, d):
    zaiko = set()
    zaiko.add(a)
    tmpzaiko = a
    plusD = d % b
    while True:
        if b > d or a < b:
            return "No"
        tmpzaiko %= b
        if tmpzaiko > c:
            return "No"
        else:
            tmpzaiko += plusD
            if tmpzaiko in zaiko:
                return "Yes"
            else:
                zaiko.add(tmpzaiko)
for el in range(n):
    array = list(map(int, input().split()))
    print(checktrue(array[0], array[1], array[2], array[3]))
