#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int pwr(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * 1LL * a) % mod;
    a = (a * 1LL * a) % mod;
    b >>= 1;
  }
  return ans;
}
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) {
    cout << "No" << '\n';
    return;
  }
  if (d < b) {
    cout << "No" << '\n';
    return;
  }
  if (c + 1 >= b) {
    cout << "Yes" << '\n';
    return;
  }
  long long st;
  if (a > c)
    st = a - ((a - c + b - 1) / b) * b;
  else
    st = a;
  if (st < 0) {
    cout << "No" << '\n';
    return;
  }
  long long dd = d % b;
  assert(st >= 0 && st <= c);
  if (dd == 0) {
    cout << "Yes" << '\n';
    return;
  }
  long long imin = (c + 1 - st + dd - 1) / dd;
  long long imax = (b - 1 - st) / dd;
  if (imin <= imax) {
    cout << "No" << '\n';
  } else {
    cout << "Yes" << '\n';
  }
}
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int tt = 1; tt <= t; tt++) {
    solve();
  }
  return 0;
}
