#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <utility>
using namespace std;
using ll = long long;

ll gcd(ll a, ll b){
  if(a < b) return gcd(b, a);

  if(b == 0) return a;
  else return gcd(b, a % b);
}

bool solve(ll a, ll b, ll c, ll d){
  if(a < b) return false;
  if(b > d) return false;
  if(c >= b) return true;

  ll g = gcd(b, d);
  ll tm = b - g + (a % b);

  return tm <= c;
}

int main(){
  int t; cin >> t;
  for(int i=0; i<t; i++){
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if(solve(a, b, c, d)){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
