#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
  ll T;
  cin>>T;
  for(ll i=0;i<T;i++){
    ll a,b,c,d;cin>>a>>b>>c>>d;
    ll sa=d-b;
    if(a<b||sa<0){
      cout<<"No"<<endl;
      continue;
    }
    if(b<=c){
      cout<<"Yes"<<endl;
      continue;
    }
    if(sa==0){
      a=a-a/b*b;
      //cout<<a<<endl;
      if(a<=c)
	cout<<"Yes"<<endl;
      else
	cout<<"No"<<endl;
      continue;
    }
    //  cout<<a-a/b*b<<endl;
    if((a-a/b*b)>c&&(a-a/b*b)<b){
      cout<<"No"<<endl;
      continue;
    }
    bool flag=true;
    a=c/sa*sa;
    //cout<<a<<endl;
    if(a+sa<b){
      cout<<"No"<<endl;
      continue;
    }
    if()
    //    cout<<a<<endl;
    //a=a+(c/sa)*sa;
    cout<<"Yes"<<endl;
  }

  return 0;
}
