N=int(input())
def upfunc(b,c,d,x):
    if (x-b-c)%b==0:
        return(b+c)
    else:
        return((x-b-c)%b + c)
def downfunc(b,c,d,x):
    if b==d:
        return(x)
    else:
        if (x-b-c)%(d-b) != 0:
            return((x-b-c)%(d-b) + b+c)
        else:
            return(d+c)
def simulate(b,c,d,x):
    if x>b+c:
        return(upfunc(b,c,d,x))
    else:
        return(downfunc(b,c,d,x))
def solve(a,b,c,d):
    if b>d:
        return("No")
    if b>a:
        return("No")
    if b<=c:
        return("Yes")
    appear = set()
    appear.add(a)
    while True:
        a = simulate(b,c,d,a)
        if a < b:
            return("No")
        if a in appear:
            return("Yes")
        appear.add(a)
for _ in range(N):
    a,b,c,d=map(int,input().split())
    print(solve(a,b,c,d))