if __name__ == '__main__':
    T = int(input())

    for num in range(T):
        array = list(map(int, input().split()))
        A = array[0]
        B = array[1]
        C = array[2]
        D = array[3]
        result = []

        if A < B or B > D or A % B > C:
            print("No")
            continue
        elif B == D:
            print("Yes")
            continue

        morning = A
        noon = morning % B

        while True:
            if noon <= C:
                night = noon + D
            else:
                night = noon

            if night - B < 0:
                print("No")
                break

            result.append(noon)
            morning = night
            noon = morning % B
            if noon in result:
                print("Yes")
                break
            if noon == morning:
                print("No")
                break