#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using VI = vector<ll>;
using VB = vector<bool>;
using VP = vector<P>;
static const ll kIntMax = numeric_limits<ll>::infinity();
static const double kFloatMax = numeric_limits<double>::infinity();
vector<ll> vi;
ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);
  assert(a > 0ll);
  if (b == 0ll)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int T;
  cin >> T;
  ll a, b, c, d;
  bool ok;
  ll p, q, s, t, mod, r;
  for (ll i = 0; i < (T); i++) {
    cin >> a >> b >> c >> d;
    ok = true;
    ok &= a >= b;
    ok &= a % b <= c;
    ok &= d >= b;
    if (d % b > 0 && c < b - 1ll) {
      mod = gcd(b, d % b);
      r = ((a - b) % c) % mod;
      ok &= !((c - r) / mod * mod + mod + r < b);
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
