def checkKaburi(arr, num):
    if num in arr:
        return True
    else:
        return False

T = int(input())
arr = []
for i in range(T):
    A,B,C,D = list(map(int,input().split()))
    noon = []
    bottle = A
    flag = True
    while 1:
        if checkKaburi(noon, bottle):
            break
        noon.append(bottle)
        num = ((bottle-C)//B + ((bottle-C)%B!=0))
        if num < 1:
            num = 1
        bottle -= num * B
        if bottle < 0:
            flag = False
            break
        if bottle <= C:
            bottle += D
    if flag:
        print('Yes')
    else:
        print('No')
