t = int(input())
res = []
for i in range(t):
    a,b,c,d = list(map(int, input().split()))
    m = -((-c+a%b)//(d-b))
    k = a%b+m*(d-b)
    if a%b>c or a<b or b>d:
        res.append('No')
    elif k>c and k<b:
        res.append('No')
    else:
        res.append('Yes')
for j in range(t):
    print(res[j])
