#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int t;
  cin>>t;
  for(int cn=0;cn<t;cn++){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(b>d||a<b||((a%b)>c)){
      cout<<"No"<<endl;
      continue;;
    }
    if(b==d){
      if(a%b<=c)cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
      continue;
    }
    if(b<=c+1||c+d==a||__gcd((d-b),c)>1){
      cout<<"Yes"<<endl;
      continue;
    }
    cout<<"No"<<endl;
  }
  return 0;
}
