#include <bits/stdc++.h>
using namespace std;
unsigned long long int func(unsigned long long int a, unsigned long long int b,
                            unsigned long long int c, unsigned long long int d,
                            int n) {
  return (c / (d - b) + n) * (d - b) + a % (d - b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  unsigned long long int a[1000], b[1000], c[1000], d[1000];
  cin >> t;
  for (unsigned long long int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    if (a[i] < b[i] || d[i] < b[i]) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    } else if (b[i] - c[i] <= 1) {
      std::cout << (true ? "Yes" : "No") << endl;
      continue;
    }
    a[i] %= b[i];
    if (a[i] < b[i] && a[i] > c[i]) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    } else if ((d[i] - b[i]) % b[i] == 0) {
      std::cout << (true ? "Yes" : "No") << endl;
      continue;
    }
    if ((func(a[i], b[i], c[i], d[i], 0) < b[i] &&
         func(a[i], b[i], c[i], d[i], 0) > c[i]) ||
        (func(a[i], b[i], c[i], d[i], 1) < b[i] &&
         func(a[i], b[i], c[i], d[i], 1) > c[i]) ||
        (func(a[i], b[i], c[i], d[i], 2) < b[i] &&
         func(a[i], b[i], c[i], d[i], 2) > c[i]) ||
        (func(a[i], b[i], c[i], d[i], -1) < b[i] &&
         func(a[i], b[i], c[i], d[i], -1) > c[i]) ||
        (func(a[i], b[i], c[i], d[i], -2) < b[i] &&
         func(a[i], b[i], c[i], d[i], -2) > c[i])) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    }
    std::cout << (true ? "Yes" : "No") << endl;
  }
  return 0;
}
