#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n), c(n), d(n);
  long long i, j;
  for (i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  string result;
  long long abuf, gcdbuf, maxbuf;
  for (i = 1; i < n; i++) {
    if (a[i] < b[i] || b[i] > d[i])
      result = "No";
    else if (b[i] <= c[i] + 1)
      result = "Yes";
    else {
      abuf = a[i] % b[i];
      gcdbuf = gcd(b[i], d[i]);
      maxbuf = b[i] - gcdbuf + (abuf % gcdbuf);
      if (maxbuf <= c[i])
        result = "Yes";
      else
        result = "No";
    }
    cout << result << endl;
  }
  return 0;
}
