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

def judge(l):
    A = l[0]
    B = l[1]
    C = l[2]
    D = l[3]
    init = []
    while(1):
        if A-B < 0:
            return 'No'
        else:
            i=A%B
            if i > C:
                return 'No'
        j=0
        j = C//B
        while(B*j+i>C):
            j=j+1
        if j-1<0:
            j=1
        rest = B*(j-1)+i+D
        A = rest
        if A in set(init):
            break
        else:
            init.append(A)
    #         rest = A-B*(i+1)
    #         rest=rest+D
    #     A=rest
    return 'Yes'

ans = list(map(judge,a))
for a in ans:
    print(a)
