t = int(input())
abcd = [[int(i) for i in input().split()] for i in range(t)] 
counter = 0
for qu in abcd:
    if qu[0] < qu[1]:
        print("No")
    elif qu[1]-1<=qu[2]:
        if qu[3] < qu[1]:
            print("No")
        else:
            print("Yes")
    else:
        amod = qu[0]%qu[1]
        dmod = qu[3]%qu[1]
        deadzone = range(qu[2]+1,qu[1])
        cycle = []
        flag = True
        while(flag):
            if amod in deadzone:
                print("No")
                flag = False
            elif amod in cycle:
                print("Yes")
                flag = False
            else:
                cycle.append(amod)
                amod = (amod + dmod) % qu[1]



