#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;
ll gcd(ll a,ll b){
    ll r=a%b; 
    while(r!=0){ 
      a=b; 
      b=r; 
      r=a%b; 
    }
    return b;
}
int main(){
  int t;cin>>t;
  for(int i=0;i<t;i++){
    ll a,b,c,d;cin>>a>>b>>c>>d;
    if(b>a){cout<<"No"<<endl;continue;}
    if(b>d){cout<<"No"<<endl;continue;}
    if(c>=b){cout<<"Yes"<<endl;continue;}
    ll g=gcd(d,b);
    if(b-g+(a%g))<=c)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}