#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (const auto &v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
i64 gcd(i64 a, i64 b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
int id = 0;
void solve() {
  ++id;
  i64 A, B, C, D;
  cin >> A >> B >> C >> D;
  if (B > D) {
    cout << "No" << endl;
    return;
  }
  i64 k;
  if ((A - C) % B != 0)
    k = (A - C) / B;
  else
    k = (A - C) / B - 1;
  k = max((i64)0, k);
  A = A - k * B;
  if (A - B < 0) {
    cout << "No" << endl;
    return;
  };
  ;
  ;
  set<pair<i64, i64>> que, done;
  if (B >= 1) que.insert(make_pair(1, B - 1));
  if (B >= 1) done.insert(make_pair(1, B - 1));
  i64 cnt = 0, lim = 30000;
  while (!que.empty() and cnt < lim) {
    auto p = *que.begin();
    que.erase(p);
    ++cnt;
    i64 l = p.first, r = p.second;
    cerr << "[" << l << ", " << r << "]" << endl;
    if (l <= A and A <= r) {
      cout << "No" << endl;
      return;
    }
    if (l >= B + C + 1 and A - l >= 0 and (A - l) % B <= r - l) {
      ;
      cout << "No" << endl;
      return;
    }
    {
      i64 l2 = max(l + B, B + C + 1), r2 = r + B;
      bool f = true;
      if (l2 > r2 or (l <= l2 and r2 <= r)) f = false;
      if (l2 <= A and A <= r2) {
        cout << "No" << endl;
        return;
      }
      auto p2 = make_pair(l2, r2);
      ;
      ;
      if (f and done.find(p2) == done.end()) {
        done.insert(p2);
        que.insert(p2);
      }
    }
    {
      i64 l2 = max(l + B - D, (i64)0), r2 = min(r + B - D, B + C);
      bool f = true;
      if (l2 > r2 or (l <= l2 and r2 <= r)) f = false;
      if (l2 <= A and A <= r2) {
        cout << "No" << endl;
        return;
      }
      if (r2 < 0) continue;
      auto p2 = make_pair(l2, r2);
      ;
      ;
      if (f and done.find(p2) == done.end()) {
        done.insert(p2);
        que.insert(p2);
      }
    }
  }
  cout << "Yes" << endl;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(16);
  i64 T;
  cin >> T;
  for (i64 i = i64(0), i_max_for_repmacro = i64(T); i < i_max_for_repmacro; ++i)
    solve();
  return 0;
}
