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 gcd(a, b: int): int =
  var a = a
  var b = b
  while b != 0:
    let tmp = a mod b
    a = b
    b = tmp
  return a

proc solve(a, b, c, d: int): bool =
  if b > d:
    return false

  if b == d:
    if a <= c:
      return a >= b
    else:
      let aa = (c + 1) + (a - (c + 1)) mod b
      return aa - b >= 0

  assert b < d
  var aa = a
  if a <= c:
    if b > a:
      return false
    aa = (c + 1) + ((c + 1) - a + (d - b - 1)) div (d - b) * (d - b)

  aa = (c + 1) + (a - (c + 1)) mod b

  if c >= b:
    return true

  let th = b - (c + 1)
  # [th, b) : true
  # [0, th) : false
  if th == 0:
    return true

  if d mod b == 0:
    return aa >= b

  if gcd(d mod b, b) == 1:
    return false

  let p = (aa - (c + 1)) mod (d mod b)
  return p in th..<b


proc main() =
  let q = readInt1()
  var qs = newSeq[(int, int, int, int)](q)
  for i in 0..<q:
    qs[i] = readInt4()

  for i in 0..<q:
    echo if solve(qs[i][0], qs[i][1], qs[i][2], qs[i][3]): "Yes" else: "No"

main()

