T=int(input())
Juice=[None]*T
for i in range(T):
    Juice[i]=list(map(int,input().split()))

#A最初の在庫,Bすぬけ君が買う本数,C以下の場合D追加


#A→A%B
def juicecheck(i):
    if Juice[i][0]<Juice[i][1]:
        print("No")
        return
    juice=Juice[i][0]
    juicelist=set()
    while True:
        juice=juice%Juice[i][1]
        #print(juice)
        if juice in juicelist:
            print("Yes")
            break
        else:
            juicelist=juicelist|{juice}
        if juice<=Juice[i][2]:
            juice+=Juice[i][3]
        #print(juice)
        if juice<Juice[i][1]:
            print("No")
            break

for i in range(T):
    juicecheck(i)
