parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function rng(a,b,c,d)
	if a<b || b>d || a%b > c
		println("No")
	else
		lbd = gcd(b,d)
		rem = a%b
		while rem < b
			rem += lbd
		end
		if rem-lbd > c
			println("No")
		else
			println("Yes")
		end
	end
end

function main()
	n = readline() |> parseInt
	for i in 1:n
		a,b,c,d = readline() |> split |> parseMap
		rng(a,b,c,d)
	end
end

main()