#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll extgcd(ll a, ll b, ll &x, ll &y) {
  ll d;
  return b == 0 ? (x = 1, y = 0, a)
                : (d = extgcd(b, a % b, y, x), y -= a / b * x, d);
}
ll modinv(ll a, ll mod = 1e9 + 7) {
  ll x = 0, y = 0;
  extgcd(a, mod, x, y);
  return (x + mod) % mod;
}
ll modpow(ll a, ll b, ll mod = 1e9 + 7) {
  ll r = 1;
  a %= mod;
  while (b) {
    if (b & 1) r = r * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
template <typename T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  for (size_t i = 0; i < v.size(); i++)
    o << v[i] << (i + 1 != v.size() ? " " : "");
  return o;
}
int sol() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  if (b > d) return 0;
  if (a < b) return 0;
  ll m = c + 1;
  vector<ll> val(2);
  for (int i = 0; i < 2; i++) {
    ll t = (a - c + b - 1) / b;
    t = min(t, a / b);
    a -= t * b;
    if (a > c) return 0;
    (0);
    val[i] = (a % m + m) % m;
    if (i == 1 && val[1] < val[0]) val[0] = val[1], i--;
    if (i == 0) a += d;
  }
  ll di = ((val[1] - val[0]) % m + m) % m;
  if (di == 0) return 1;
  ll s = val[0];
  ll s1 = s + (m - 1 - s) / di * di;
  if (s1 + di < b) return 0;
  ll f1 = ((s1 + di - b) % m + m) % m;
  ll s2 = f1 + (m - 1 - f1) / di * di;
  (0);
  ll ds = ((s1 - s2) % m + m) % m;
  ll g = gcd(ds, m);
  (0);
  d %= b;
  if (g == 0) g = m;
  ll f = s2;
  f += (b - 1 - f) / g * g;
  if (f > c) return 0;
  return 1;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    (0);
    cout << ((sol()) ? "Yes" : "No") << endl;
    ;
  }
  return 0;
}
