#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def gcd(a, b):
    if b>a:
        a, b = b, a
    while b>0:
        a, b = b, a%b
    return a

def solve(T: int, A: "List[int]", B: "List[int]", C: "List[int]", D: "List[int]"):
    for i in range(T):
        a, b, c, d = A[i], B[i], C[i], D[i]
        if a<b or b>d:
            print('No')
            continue
        x = (c-a+1)%b
        g = gcd(b, d)
        print('No' if -(-x//g*g) - x + c+1 < b else 'Yes')


    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    T = int(next(tokens))  # type: int
    A = [int()] * (T)  # type: "List[int]" 
    B = [int()] * (T)  # type: "List[int]" 
    C = [int()] * (T)  # type: "List[int]" 
    D = [int()] * (T)  # type: "List[int]" 
    for i in range(T):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
        D[i] = int(next(tokens))
    solve(T, A, B, C, D)

if __name__ == '__main__':
    main()
