from sys import stdin

t = stdin.readline()
t_i = int(t)
data = [stdin.readline().rstrip().split() for _ in range(t_i)]
#print(data)
for i in range(t_i) :
    a = int(data[i][0])
    b = int(data[i][1])
    c = int(data[i][2])
    d = int(data[i][3])
    #print(a, b, c, d)
    if a < b :
        print("No")
    elif b > d :
        print("No")
    elif a % b > c and a % b < b :
        print("No")
    else :
        #print("Yes")
    
        stock = a
        count = 0
        while True :
            stock = stock - b
            if stock < 0 :
                print("No")
                break
            if stock <= c :
                stock = stock + d
            count = count + 1
            if count > 20 :
                print("Yes")
                break
