def ringo(A, B, C, D):
    if A < B:  # 初手売り切れ
        return "No"
    if B > D:  # どんどん減る
        return "No"
    if A <= C:
        return "Yes"
    else:
        # 初めて[0, C]となるとき->buy
        tmp = A - C
        buy = B * ((tmp + B - 1) // B)
        if A - buy < 0:
            return "No"
        if D % B == 0:
            return "Yes"
        # 初項ai, 公差dの等差数列が[C+1, B)の範囲に来るとNG
        # c+1-ai+d <= nd <= B-ai+dを満たす整数nが存在するとNG
        ai = A - buy
        d = D % B
        left = (C + 1 - ai + d + d - 1) // d
        right = (B - 1 - ai + d) // d
        if left <= right:
            return "No"
        else:
            return "Yes"


if __name__ == "__main__":
    T = int(input())
    ans = [ringo(*map(int, input().split())) for _ in range(T)]
    print(*ans, sep="\n")