fun main(args: Array<String>) {
  val t = readLine()!!.toInt()
  repeat(t) {
    solveCase()
  }
}

fun gcd(x: Long, y: Long): Long {
  if (x < y) return gcd(y, x)
  val r = x % y
  if (r == 0L) return y
  else return gcd(y, r)
}

fun solveCase() {
  val (a, b, c, d) = readLine()!!.split(" ").map { it.toLong() }
  if (a < b) {
    println("No")
    return
  }
  if (b > d) {
    println("No")
    return
  }
  if (c + 1 >= b) {
    println("Yes")
    return
  }

  val x = gcd(b, d)
  var y = a % x
  y += (c - y) / x * x
  while (y <= c) y += x
  // y >= c + 1
  if (y < b) {
    println("No")
  } else {
    println("Yes")
  }
}