#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
template <class T = long long>
T IN() {
  T x;
  cin >> x;
  return (x);
}
template <class Head>
void VT(Head head) {}
template <class Head, class Seco, class... Tail>
void VT(Head&& head, Seco&& seco, Tail&&... tail) {
  seco.resize(head);
  VT(head, move(tail)...);
}
void VT2() {}
template <class Head, class... Tail>
void VT2(Head&& head, Tail&&... tail) {
  for (auto& youso_ : (head)) cin >> youso_;
  VT2(move(tail)...);
}
template <class Head>
void VT3(Head&& head) {}
template <class Head, class Seco, class... Tail>
void VT3(Head&& head, Seco&& seco, Tail&&... tail) {
  seco[head] = IN();
  VT3(head, move(tail)...);
}
int main() {
  int t;
  CINT(t);
  auto f = [&](long long a, long long b, long long c, long long d) {
    a -= b;
    if (a < 0) return false;
    if (d < b) return false;
    auto calc = [&]() {
      long long k = (a - c + b - 1) / b;
      a -= k * b;
    };
    if (c + 1 >= b) return true;
    calc();
    if (a < 0) return false;
    long long a1 = a;
    a += d;
    calc();
    if (a < 0) return false;
    long long a2 = a;
    long long adiff = a2 - a1;
    if (!adiff) return true;
    if (adiff < 0) return false;
    long long val = (c + 1 - (a1)) / adiff;
    long long a3 = a1 + adiff * val;
    a = a3;
    calc();
    a3 = a;
    return a3 >= 0;
    cout << "a1"
         << " = " << (a1) << endl;
    ;
    cout << "a2"
         << " = " << (a2) << endl;
    ;
    cout << "adiff"
         << " = " << (adiff) << endl;
    ;
    return true;
  };
  for (int i = 0; i < (t); ++i) {
    long long a, b, c, d;
    CINT(a, b, c, d);
    cout << ((f(a, b, c, d)) ? "Yes" : "No") << endl;
  }
  return 0;
}
