def check(a, b, c, d):
    before = a - (a//b-1) * b
    diff = d - b

    if diff == 0 and a%b<=c:
        return "Yes"
    
    if diff <= 0 or a < b:
        return "No"

    for c_t in range(c+1, b):
        if (c_t + b - before) % diff == 0:
            # print("c_t:", c_t)
            return "No"
        
    else:
        return "Yes"

n = int(input())
A, B, C, D = [], [], [], []
for _ in range(n):
    a,b,c,d = list(map(int, input().split()))
    A.append(a)
    B.append(b)
    C.append(c)
    D.append(d)
    
for i in range(n):
    print(check(A[i], B[i], C[i], D[i]))
