#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 61;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long jou(long long N, long long P) {
  if (P == 0) return 1;
  if (P % 2 == 0) {
    long long t = jou(N, P / 2);
    return t * t % 1000000007;
  }
  return (N * jou(N, P - 1)) % 1000000007;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (int)(t); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long e = a - b;
    if (a > c) {
      e = a - ((a - c + b - 1) / b) * b;
    }
    if (e < 0 || e + d < b) {
      cout << "No" << endl;
      continue;
    }
    long long f = e + d - b;
    if (e + d > c) {
      f = e + d - ((e + d - c + b - 1) / b) * b;
    }
    if (f < 0 || f + d < b) {
      cout << "No" << endl;
      continue;
    }
    if (e == f || e == c) {
      cout << "Yes" << endl;
      continue;
    }
    if (e > f) {
      cout << "No" << endl;
      continue;
    }
    long long g = f - e;
    long long h = e + ((c - e) / g + 1) * g;
    if (h < b) {
      cout << "No" << endl;
      continue;
    }
    a = h;
    long long j = a - b;
    if (a > c) {
      j = a - ((a - c + b - 1) / b) * b;
    }
    if (j < 0 || j + d < b) {
      cout << "No" << endl;
      continue;
    }
    long long k = j + d - b;
    if (j + d > c) {
      k = j + d - ((j + d - c + b - 1) / b) * b;
    }
    if (k < 0 || k + d < b) {
      cout << "No" << endl;
      continue;
    }
    if (j == k || j == c) {
      cout << "Yes" << endl;
      continue;
    }
    if (j > k) {
      cout << "No" << endl;
      continue;
    }
    long long l = k - j;
    long long m = j + ((c - j) / l + 1) * l;
    if (m < b) {
      cout << "No" << endl;
      continue;
    }
    if (m >= h) {
      cout << "Yes" << endl;
      continue;
    }
    long long n = h - m;
    long long o = h - ((h - c + n - 1) / n) * n + n;
    if (o < b) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}
