T = int(input())
a = []
tmp = []
for i in range(T):
    tmp = list(map(int,input().split()))
    a.append(list(tmp))

for i in range(T):
    A = a[i][0]
    B = a[i][1]
    C = a[i][2]
    D = a[i][3]
    sa = D - B

    kei = A
    while kei - B <= C:
        kei += sa
    
    if kei - B < B:
        print('No')
    else:
        print('Yes')
