T = int(input())

def calc(A,B,C,D):
    list_ = []
    while not A in list_:
        if A<B : return False
        if A%B > C : return False
        A %= B
        if A in list_:
            return True
        list_.append(A)
        if A+D < B: return False
        A+=D

input_list = []
for _ in range(T):
    input_list.append(input())
    
for inp in input_list:
    A,B,C,D = map(int,inp.split())
    if calc(A,B,C,D):
        print("Yes")
    else:
        print("No")