#include <bits/stdc++.h>
using namespace std;
namespace {
void Solve(int64_t) {
  int64_t a, b, c, d;
  cin >> a >> b >> c >> d;
  if (d < b) {
    cout << "No\n";
    return;
  }
  if (a > c) {
    const int64_t k = (a - c + b - 1) / b - 1;
    a -= k * b;
    assert(a > c and a - b <= c);
  }
  if (a < b) {
    cout << "No\n";
    return;
  }
  a -= b;
  assert(a <= c);
  const int64_t diff = d - b;
  if (diff == 0) {
    cout << "Yes\n";
    return;
  }
  const int64_t k = (c - a) / diff + 1;
  if (a + k * diff < b) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
  }
}
void Init() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
}  // namespace
int32_t main() {
  Init();
  int64_t tests = 1;
  cin >> tests;
  for (int64_t test = 1, __test = tests + 1; test < __test; ++test) Solve(test);
  return 0;
}
