require 'pp'
# IS_DEBUG = true
IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end


T,_=gets.chomp.split(' ').map{|n| n.to_i}
0.upto(T-1){|i|
	A,B,C,D=gets.chomp.split(' ').map{|n| n.to_i}
	if(A < B)
		puts "No"
		next
	end
	if(B > D)
		puts "No"
		next
	elsif(B == D)
		if(A%B > C)
			puts "No"
		else
			puts "Yes"
		end
		next
	end
	if(A%B > C)
		puts "No"
		next
	end
	dif = D-B
	ini = A-B
	prvini = []
	flg = false
	while(true)
		nxt = (C-ini)/dif*dif+ini + dif
	    dputs "nxt #{nxt}"
	    dputs "C #{C}"
	    dputs "B #{B}"
	    if(C < nxt && nxt < B)
	    	dputs "out! C < nxt && nxt < B"
			flg = false
			break
		end
		prvini << ini
		ini = (nxt + D) % B
		dputs "next ini is #{ini}"
		if(prvini.include?(ini))
			dputs "cycle!"
			flg = true
			break
		end
	end
	if(flg)
		puts "Yes"
	else
		puts "No"
	end
}


