//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16)a; cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
map<ll,int>mapi;
int main(){
	std::ios::sync_with_stdio(false);
	int t;
	cin>>t;
	while(t--){
		ll a,b,c,d,a1,cnt;
	
		cin>>a>>b>>c>>d;
		if(a<b){
			cout<<"No"<<endl;
			continue;
		}
		a1=a;
		if(a>c){
			a-=c;
			if(a%b==0){
				a=a/b;
			}
			else{
				a=a/b+1;
			}
			a=a1-a*b;
		}
		//cout<<a<<endl;
		if(a<0){
			cout<<"No"<<endl;
			continue;
		}
		if(d==b){
			cout<<"Yes"<<endl;
			continue;
		}
		if(c>=b&&d>=b){
			cout<<"Yes"<<endl;
			continue;
		}
		if(b>d){
			cout<<"No"<<endl;
			continue;
		}
		mapi.clear();
		cnt=301;
		while(cnt--){
			if(mapi[a]==1){
				cout<<"Yes"<<endl;
				break;
			}
		 	mapi[a]=1;
		 	a1=a;
		 	a=c-a;
		 	a=a/(d-b);
		 	a++;
		 	a=a1+a*(d-b);
		 	if(a<b){
		 		cout<<"No "<<endl;
		 		break;
		 	}
		 	a1=a;
		 	a-=c;
			if(a%b==0){
				a=a/b;
			}
			else{
				a=a/b+1;
			}
			a=a1-a*b;
			if(a<0){
				cout<<"No"<<endl;
				break;
			}
			cnt--;
		}
		if(cnt==0){
			cout<<"No"<<endl;
		}
	}
} 
	