#include<bits/stdc++.h>
using namespace std;
int T;
long long a,b,c,d,g;
void solve(){
	cin>>a>>b>>c>>d;
	if(b>a){cout<<"No"<<endl;return;}
	if(b>d){cout<<"No"<<endl;return;}
	if(b<=c){cout<<"Yes"<<endl;return;}
	g=__gcd(b,d);
	if(a%g) cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
} 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>T;
	while(T--) solve();
	return 0;
}
