#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int tx[8] = {-1, 0, 1, -1, 1, -1, 0, 1},
          ty[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ll t, a, b, c, d;
  cin >> t;
  for (int z = 0; z < t; z++) {
    cin >> a >> b >> c >> d;
    ll st = a - b;
    if (st < 0) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    ll g = gcd(b, d);
    ll cc = (c - a % b) / g, bb = (b - a % b) / g, ccc = c - a % b,
       bbb = b - b % a;
    if (ccc < 0 && bbb < 0) {
      cout << "Yes" << endl;
      continue;
    }
    if (bb - cc >= 2 || b - a % b > 0 && c - a % b < 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
