import numpy as np
if __name__ == "__main__":
    T = input().rstrip().split(' ')
    T = int(T[0])
    for t in range(T):
        line = input().rstrip().split(' ')
        A = int(line[0])
        B = int(line[1])
        C = int(line[2])
        D = int(line[3])
        A_list = []
        flag = False
        while True:
            if A in A_list:
                flag = True
                break
            A_list.append(A)
            if A < B:
                break
            A = A % B
            while (A <= C):
                A += B
            A_list.append(A)
            A = A - B
            #n = np.floor((A-C)/B)
            #print(n)
            #A = A - n * B
            #print(f"night:{A}")
            if A <= C:
                A = A + D
        if flag:
            print('Yes')
        else:
            print('No')