n = int(input())
grid =[]
for i in range(n):
    array = list(map(int, input().strip().split()))
    grid.append(array)

def checktrue(a, b, c, d):
    zaiko = []
    zaiko.append(a)
    tmpzaiko = a
    plusD = d % b
    while True:
        if b > d or a < b:
            return "No"
        tmpzaiko %= b
        if tmpzaiko > c:
            return "No"
        else:
            #もし在庫が補充量を下回ってたら在庫を追加する
            if tmpzaiko <= c:
                tmpzaiko += plusD
            if tmpzaiko in zaiko:
                return "Yes"
            else:
                zaiko.append(tmpzaiko)
for el in range(n):
    a = grid[el][0]
    b = grid[el][1]
    c = grid[el][2]
    d = grid[el][3]
    print(checktrue(a, b, c, d))
