#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
using ld = long double;
const int ITER = 100 * 1000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  for (int tt = 0; tt < t; tt++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a) {
      cout << "No\n";
      continue;
    }
    auto go = [&](ll x) {
      if (x <= c) {
        return x - b;
      }
      ll more = (x - c);
      ll steps = more / b;
      if (more % b) {
        steps++;
      }
      if (steps == 0) {
        steps = 1;
      }
      return x - steps * b;
    };
    ll x = a;
    bool win = true;
    for (int it = 0; it < ITER; it++) {
      x = go(x);
      if (x < 0) {
        win = false;
        break;
      } else if (x + d < b) {
        win = false;
        break;
      } else {
        x += d;
      }
    }
    if (win) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
