#include "bits/stdc++.h"
using namespace std;

int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = gcd(b, d);
    if (c >= b-g+a%g) {
      cout << "Yes" << endl;
      continue;
    }
    else {
      cout << "No" << endl;
      continue;
    }
  }
    
 
  return 0;
}