#include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline unsigned long long xorshift() {
  static unsigned long long x = 88172645463325252ull;
  x = x ^ (x << 7);
  return x = x ^ (x >> 9);
}
ll gcd(ll a, ll b) {
  if (min(a, b) == 0) {
    return max(a, b);
  }
  if (a % b == 0) {
    return b;
  }
  return gcd(b, a % b);
}
bool solve(ll a, ll b, ll c, ll d) {
  if (a < b) {
    return false;
  }
  if (b > d) {
    return false;
  }
  if (b <= c) {
    return true;
  }
  ll g = gcd(b, d);
  if (b - g + a % g > c) {
    return false;
  }
  return true;
}
bool solve2(ll a, ll b, ll c, ll d) {
  if (a < b) {
    return false;
  }
  if (b > d) {
    return false;
  }
  if (b <= c + 1) {
    return true;
  }
  if (b == d) {
    if (a - b * (a / b) < c) {
      return true;
    } else {
      return false;
    }
  }
  if (a % b > c) {
    return false;
  }
  ll t = gcd(d - b, b);
  ll s = a - t * (a / t);
  ll x = s + t * (c + t - s) / t;
  if (x < b) {
    return false;
  }
  return true;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (solve(a, b, c, d) != solve2(a, b, c, d)) {
      cerr << a << endl;
      cerr << b << endl;
      cerr << c << endl;
      cerr << d << endl;
      assert(0);
    }
    if (solve(a, b, c, d)) {
      cout << "Yes" << '\n';
    } else {
      cout << "No" << '\n';
    }
  }
  t = 1000;
  while (t--) {
    ll a, b, c, d;
    a = xorshift() % 1000000000000000000ll + 1;
    b = xorshift() % 1000000000000000000ll + 1;
    c = xorshift() % 1000000000000000000ll + 1;
    d = xorshift() % 1000000000000000000ll + 1;
    if (solve(a, b, c, d) != solve2(a, b, c, d)) {
      cerr << a << endl;
      cerr << b << endl;
      cerr << c << endl;
      cerr << d << endl;
    }
  }
  return 0;
}
