#include <bits/stdc++.h>
using namespace std;
const long long INF = numeric_limits<long long>::max() / 4;
const long long MOD = 1e9 + 7;
const int n_max = 1e5 + 10;
template <class T, class U>
long long euclid_gcd(T a, U b) {
  if (a < b) return euclid_gcd(b, a);
  long long r;
  while ((r = a % b)) {
    a = b;
    b = r;
  }
  return b;
}
int main() {
  long long t;
  cin >> t;
  vector<long long> a(t), b(t), c(t), d(t);
  for (long long i = 0; i < (long long)(t); i++)
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  bitset<n_max> ans(0);
  for (long long i = 0; i < (long long)(t); i++) {
    if (d[i] % b[i] == 0) {
      ans[i] = (a[i] >= b[i] && a[i] % b[i] <= c[i]);
    } else if (d[i] < b[i]) {
      ans[i] = 0;
    } else {
      long long step = d[i] % b[i];
      long long f = a[i] % b[i];
      long long g = euclid_gcd(b[i], step);
      long long jud = b[i] - (f % g == 0 ? g : f % g);
      if (jud == b[i]) jud -= step;
      ans[i] = (jud <= c[i] && a[i] >= b[i] && f <= c[i]);
    }
  }
  for (long long i = 0; i < (long long)(t); i++)
    cout << (ans[i] ? "Yes" : "No") << endl;
}
