#coding: utf-8

def getInput():
    in_row = [ int(x) for x in input().split(" ") ]
    return in_row

def judgeTakahashi(in_row):
    A = in_row[0] # initial stock
    B = in_row[1] # initial Takahashi
    C = in_row[2]
    D = in_row[3]
    loop = []

    if A < B:
        return False

    # daytime - purchase
    while A not in loop:
        loop.append(A)
        A %= B

        # night - fill
        if A <= C:
            A += D

        if A < B:
            return False
    
    return True
    
    
if __name__ == "__main__":
    N = int(input())
    for i in range(N):
        in_row = getInput()
        result = "Yes" if judgeTakahashi(in_row) else "No"
        print(result)
    
