N = int(input())

def check_unique(list_tmp):
    L1 = len(list_tmp)
    L2 = len(list(set(list_tmp)))
    if L1 == L2:
        return True
    else:
        return False

def test(A,B,C,D):
    bottles = A
    bottles_log = []
    while bottles >0:
        bottles_log.append(bottles)
        #print(bottles)
        
        if check_unique(bottles_log):
            if bottles >= B:
                bottles = bottles -(A//B) * B
                if bottles <= C :
                    bottles += D 
            else:
                return("No")
            
        else:
            return("Yes")
        
    return("No")

for i in range (N):
    A,B,C,D =  map(int,input().split())
    print(test(A,B,C,D))