
object Main extends App{
  import scala.io.StdIn._
  import scala.math.abs
  val t = readLine.trim.toInt
  for (_ ← 0 until t){
    val Array(a, b, c, d) = readLine.trim.split(' ').map(_.toLong)
    if (a < b || d < b) println("No")
    else if (c >= b) println("Yes")
    else{// B > rest > C
      // B > A + xD - yB > C
      // B - A > xD - yB > C - A
      // A - C > yB - xD > A - B
      val diff = (a % b)
      val g = gcd(b, d)
      println(
        if ((a - c - 1) / g != (a - b) / g) "No"
        else "Yes"
      )
    }
  }
  def gcd(a:Long, b:Long):Long = {
    b match{
      case 0 ⇒ a
      case _ ⇒ gcd(b, a % b)
    }
  }
}