from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import copy

T=int(input())
ABCD=[list(map(int,input().split())) for i in range(T)]
for A,B,C,D in ABCD:
    if B>D or A<B:
        print("No")
    elif B==D:
        if A-B<=C:
            print("Yes")
        else:
            print("No")
    else:
        E=B-C-1
        if E>0:
            F=D-B
            if E>F:
                print("No")
            else:
                _gcd=gcd(F,A)
                st=(A-B)%_gcd
                #if A==14 and B==10 and C==8 and D==12:
                #    print(B-C-1)
                if B-C-1>=_gcd:
                    print("No")
                else:
                    end1,end2=C+1,B-1
                    end1%=_gcd
                    end2%=_gcd
                    if end1<=end2:
                        if end1<=st<=end2:
                            print("No")
                        else:
                            print("Yes")
                    else:
                        if end1<=st<=_gcd-1 or 0<=st<=end2:
                            print("No")
                        else:
                            print("Yes")
        else:
            print("Yes")
