var
	T,i:Longint;
	A,B,C,D,G:int64;
function gcd(a,b:int64):int64;
begin
	if b=0 then gcd:=a else gcd:=gcd(b,a mod b);
end;
begin
	read(T);
	for i:=1 to T do begin
		read(A,B,C,D);
		G:=gcd(B,D);
		if(B>A)or(B>D)or(B>(-A mod G+G)mod G+C+1)then writeln('No')else writeln('Yes');
	end;
end.