T = int(input())
A = []
B = []
C = []
D = []
for i in range(T):
    a, b, c, d = map(int, input().split())
    A.append(a)
    B.append(b)
    C.append(c)
    D.append(d)
res = ['Yes' for i in range(T)]
for cnt in range(T):
    query = [A[cnt], B[cnt], C[cnt], D[cnt]]
    if query[0] % query[1] > query[2]:
        res[cnt] = 'No'
    else:
        hiru = []
        yoru = []
        hiru.append(query[0])
        yoru.append(query[0]%query[1])
        for i in range(100):
            if yoru[-1] <= query[2]:
                hiru.append(yoru[-1] + query[3])
                yoru.append(hiru[-1]%query[1])
            else:
                hiru.append(yoru[-1])
                yoru.append(hiru[-1] - query[1])
                
        if min(yoru) < 0:
            res[cnt] = 'No'