import strutils, sequtils

proc input: string =
  while true:
    let tmp = readChar stdin
    if not isSpace tmp:
      safeAdd result, tmp
    elif tmp != '\r': break


proc fn: string =
  let
    A, B, C, D = parseInt input()
  var
    cnt = A
    cnt0 = -1
    flg = true

  if B > D: return "No"  

  while flg or cnt != A:
    if cnt < B:
      return "No"

    if C mod B == 0: break

    cnt = cnt mod B
    if cnt == cnt0: break

    if flg:
      cnt0 = cnt
      flg = false

    if cnt <= C:
      cnt += D

  return "Yes"

let T = parseInt readLine stdin
var ans = newSeq[string]()

for i in 1 .. T:
  add ans, fn()

echo ans.join("\n")
