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:
        if a<=b+c:
            return("Yes")
        else:
            x=b+c-(b+c-a)%b
            if x<b:
                return("No")
    if b>d:
        return("No")
    if b>a:
        return("No")
    if b<=c:
        return("Yes")
    if c+1>=b:
        return("Yes")
    
    import math as m
    g = m.gcd(d-b,b)
    x = (a-b-c-1)%g + b+c+1
    if x-b>=b:
        return("Yes")
    else:
        return("No")
for _ in range(N):
    a,b,c,d=map(int,input().split())
    print(solve(a,b,c,d))