def judge(A,B,C,D):
    if (A - B < 0) or (D - B < 0): return False
    if C - B >= 0: return True
    if D - B == 0:
        n = (A - C - 1) // B
        return True if (0 <= (A - B) - B * n) else False

    # 初項(A-B) 公差(D-B)の等差数列a
    # a: C以上となる数
    n = (C - A - B + 2 * D) // (D - B)
    a = (A - B) + (n - 1) * (D - B)
    return a >= B

T = int(input())
for _ in range(T):
    A,B,C,D = map(int, input().split())
    flag = judge(A,B,C,D)
    if flag:
        print('Yes')
    else:
        print('No')