#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def debug_print(s):
    pass
    # print(s, end="")

def solve2(A, B, C, D):
    def before_C(v):
        if v > C:
            tmp = v - ( (v - C) // B ) * B
            if tmp == C and tmp + B <= v:
                tmp += B
            return tmp
        else:
            return v
    if B > A:
        debug_print("(1)")
        return "No"
    if B > D:
        debug_print("(2)")
        return "No"
    if B <= C:
        debug_print("(3)")
        return "Yes"

    A = before_C(A)
    if B > A:
        debug_print("(4)")
        return "No"

    if A <= C:
        A -= B
        A += D

    seen = set()
    while True:
        A = before_C(A)
        if A < 0:
            return "No"
        if A <= C:
            A += D
        if A in seen:
            return "Yes"
        seen.add(A)

    return "unknown"

    gcd1 = gcd(B, D)
    gcd2 = gcd((A - B), (B - C))
    if gcd2 % gcd1 == 0:
        return "Yes"
    else:
        return "No"

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

    

def solve():
    A, B, C, D = map(int, input().split())
    return solve2(A, B, C, D)

    
T = int(input())
for t in range(T):
    print(solve())

