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