#include<iostream>
using namespace std;
int main()
{
	int T;
	cin >> T;
	bool is_ok[T];
	unsigned long long int A,B,C,D,R;
	for(int i=0;i<T;i++)
	{
		is_ok[i] = false;
		cin >> A >> B >> C >> D;
		if(A<B) 	continue;
		if(D<B)		continue;
		if(C<A%B)	continue;
		if(C<B-gcd(B,D))	continue;
		is_ok[i] = true;
	}
	for(int i=0;i<T;i++)
		if(is_ok[i]) 	cout << "Yes" << std::endl;
		else			cout << "No" << std::endl;
	return 0;
}