T = int(input())
ABCD = [[int(i) for i in input().split()] for _ in range(T)]

for A, B, C, D in ABCD :
    a0 = A - (A - C + B - 1) // B * B
    if a0 < 0 or A < B or D < B :
        print('No')
    elif B - C >= 2 and D > B :
        d = D - B
        # C以下で最大のものを見つける
        ac = (C - a0) // d * d + a0
        if ac < 0 or ac + d < B :
            print('No')
        else :
            print('Yes')
    else :
        print('Yes')