#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
typedef long long ll;
ll MOD = 1e9+7;

using namespace std;

int main()
{
	int t;
	int ans=0;
	
	cin>>t;
	for(int i=0;i<t;i++)
	{
		ll a,b,c,d;
		cin>>a>>b>>c>>d;
		if(a<b || b>d)
		{
			cout<<"No"<<endl;
		}else if(b==d){
			if(a%b<=c)
				cout<<"Yes"<<endl;
			else
				cout<<"No"<<endl;
		}else if(b<=c){
			cout<<"Yes"<<endl;
		}else{
			// a<b && b<d && b>c
			ll cnt=0;
			ll n=a;
			bool f=true;
			while(cnt<300000)
			{
				n%=b;
				n+=b*(max(c-n,0)/b);
				if(n>c && n<b)
				{
					f=false;
					break;
				}
				n+=d;
				cnt++;
			}
			if(f)
				cout<<"Yes"<<endl;
			else
				cout<<"No"<<endl;
			//cout<<"Unknown"<<endl;
		}
	}
	//cout<<ans<<endl;
	return 0;
}