#include <bits/stdc++.h>
using namespace std;
bool solve(long long int a, long long int b, long long int c, long long int d) {
  if (a < d) {
    long long int x = b - b % (a % b);
    return x <= c;
  } else if (a == d) {
    long long int x = b - b % (a % b);
    return x <= c;
  } else if (d < a) {
    long long int x = b - b % (a % d);
    return x <= c;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (auto times = 0; times < (t); times++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = false;
    if (a < b)
      f = false;
    else if (a == b) {
      if (d < b)
        f = false;
      else if (b == d) {
        if (b < c)
          f = true;
        else if (b == c)
          f = true;
        else if (c < b)
          f = true;
      } else if (b < d) {
        if (b < c)
          f = true;
        else if (b == c)
          f = true;
        else if (c < b)
          f = true;
      }
    } else if (b < a) {
      if (d < b)
        f = false;
      else if (b == d) {
        if (b < c)
          f = true;
        else if (b == c)
          f = true;
        else if (c < b)
          f = true;
      } else if (b < d) {
        if (b < c)
          f = true;
        else if (b == c)
          f = true;
        else if (c < b)
          f = solve(a, b, c, d);
      }
    }
    cout << (f ? "Yes" : "No") << endl;
  }
  return 0;
}
