fun main(args: Array<String>) {
    val t = readLine()!!.toInt()
    for (i in 0 until t) {
        val (a, b, c, d) = readLine()!!.split(' ').map(String::toLong)
        when {
            (a < b) || (d < b) || ((a % b) > c) -> {
                println("No")
            }
            (d == b && (a % b) <= c) || (b == 1L) || (a == b) -> {
                println("Yes")
            }
            else -> {
                val left = (c - a + b).toDouble() / (d - b).toDouble()
                val right = (2 * b - a).toDouble() / (d - b).toDouble()
                var ceil = Math.ceil(left)
                var floor = Math.floor(right)
                if (ceil == left) ceil++
                if (floor == right) floor--
                if (ceil <= floor) {
                    println("No")
                } else {
                    println("Yes")
                }
            }
        }
    }
}