import strutils
import sequtils
import algorithm
import math
import queues
import tables
import sets
import logging
import future

const INF* = int(1e18 + 373)

proc readSeq*(): seq[string] = stdin.readLine().strip().split()
proc readSeq*(n: Natural): seq[string] =
  result = newSeq[string](n)
  for i in 0..<n:
    result[i] = stdin.readLine().strip()

proc readInt1*(): int = readSeq().map(parseInt)[0]
proc readInt2*(): (int, int) =
  let a = readSeq().map(parseInt)
  return (a[0], a[1])
proc readInt3*(): (int, int, int) =
  let a = readSeq().map(parseInt)
  return (a[0], a[1], a[2])
proc readInt4*(): (int, int, int, int) =
  let a = readSeq().map(parseInt)
  return (a[0], a[1], a[2], a[3])

type seq2*[T] = seq[seq[T]]
proc newSeq2*[T](n1, n2: Natural): seq2[T] = newSeqWith(n1, newSeq[T](n2))

#------------------------------------------------------------------------------#

proc solve(a, b, c, d: int): bool =
  var s = a
  for _ in 0..<10^5:
    if s < b:
      return false

    if s > c:
      s -= ((s - c - 1) div b) * b

    s -= b
    if s < 0:
      return false

    if s <= c:
      s += d
  return true

proc main() =
  let t = readInt1()
  for i in 0..<t:
    let (a, b, c, d) = readInt4()
    echo if solve(a, b, c, d): "Yes" else: "No"

main()

