from math import floor
import sys
sys.setrecursionlimit(5000000)
T = int(input())
for i in range(T):
    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
                if A not in memo:
                    memo[A] = 0
                    return buy(A)
                else:
                    return(True)
    A,B,C,D = map(int,input().split())
    if B > D:
        print("No")
    else:
        if buy(A):
            print("Yes")
        else:
            print("No")


