N=int(input())
for i in range(N):
    A,B,C,D = list(map(int,input().split(" ")))
    def gcd(a, b):
        while b:
            a, b = b, a % b
        return a
    if(C+1>B or B>D or B>A):
        print("No")
    else:
        for i in range(B // gcd(B, D)):
            if(A+i*D)%B>C:
                print("No")
                break
        else:
            print("Yes")