def gcd(x,y):
    a = min(x,y)
    b = max(x,y)
    if a == 1:
        return(1)
    else:
        r = b%a
        if r==0:
            return(a)
        else:
            return(gcd(a,r))
N=int(input())
def solve(a,b,c,d):
    if b>d:
        return("No")
    if b>a:
        return("No")
    if b<=c:
        return("Yes")
    if c+1>=b:
        return("Yes")
    if b==d:
        if a<=b+c:
            return("Yes")
        else:
            x=b+c-(b+c-a)%b
            if x<b:
                return("No")
    g = 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))