t = gets.to_i
a=[], b=[],c=[],d=[]
t.times do |i|
	a[i],b[i],c[i],d[i] = gets.split.map(&:to_i)
end

t.times do |i|
	aa = a[i]
	bb = b[i]
	cc = c[i]
	dd = d[i]

	if aa < bb || bb > dd
		puts 'No'
		next
	end

	
	res = aa % bb
	tmp = dd % bb

	if tmp > bb-cc
		puts 'Yes'
		next
	end


	while true
		if cc < res && res < bb
			puts 'No'
			break
		elsif res > bb || tmp == 0
			puts 'Yes'
			break
		end
		res += tmp
	end
end
