#include<bits/stdc++.h>
#define randome_generate srand(std::chrono::high_resolution_clock::now().time_since_epoch().count())
using namespace std;
int t;
long long a,b,c,d,g,yu;
void solve(){
	cin>>a>>b>>c>>d;
	if(b>a){
		cout<<"No"<<endl;
		return;
	}
	if(b>d){
		cout<<"No"<<endl;
		return;
	}
	g=__gcd(b,d);
	yu=a%g;
	//MIN mod g ...yu,MIN>=c-b+1
	long long mm=(c-b+1LL)/g*g+yu;
	if(mm<(c-b+1LL))
		mm+=g;
	assert((mm%g+g)%g==yu);
	if(mm>=0){
		cout<<"Yes"<<endl;
		return;
	}
	cout<<"No"<<endl;
}
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>t;
	while(t--)
		solve();
	return 0;
}
