from math import floor
import sys
sys.setrecursionlimit(500000)
T = int(input())
for i in range(T):
    if B > D:
        print("No")
    else:
        memo = {}
        def buy(A):
            if A < B:
                return False
            else:
                if A % B > C:
                    return False
                else:
                    A = floor((C-A%B)/B)*B+A%B+D%B
                    if A not in memo:
                        memo[A] = 0
                        return buy(A)
                    else:
                        return(True)
        A,B,C,D = map(int,input().split())
        if buy(A):
            print("Yes")
        else:
            print("No")


