#include <bits/stdc++.h>
using namespace std;
int gcd(long long int x, long long int y) {
  int mod;
  if (x % y == 0) {
    return y;
  } else {
    mod = x % y;
    mod = gcd(y, mod);
  }
  return mod;
}
int main() {
  int t;
  cin >> t;
  long long int a, b, c, d;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (b > a || b > d) {
      cout << "No" << endl;
    } else if (c >= b) {
      cout << "Yes" << endl;
    } else {
      long long int g = gcd(d, b);
      long long int sum = b - g + a % g;
      if (c >= sum) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
