#include <bits/stdc++.h>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
template <ostream& out = cout, class... T>
void prints(T&&...) {}
template <ostream& out = cout, class... T>
void printe(T&&...) {}
template <ostream& out = cout, class... T>
void printw(T&&...) {}
template <ostream& out = cout, class... T>
void printew(T&&...) {}
template <ostream& out = cout, class... T>
void printb(T&&...) {}
template <ostream& out = cout, class... T>
void printd(T&&...) {}
template <ostream& out = cout, class... T>
void printde(T&&...){};
template <class S, class T>
istream& operator>>(istream& in, pair<S, T>& p) {
  in >> p.first >> p.second;
  return in;
}
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
  for (auto& e : v) {
    in >> e;
  }
  return in;
}
ll gcd(ll a, ll b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int _ = 0; _ < t; _++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << '\n';
      continue;
    }
    if (c >= b - 1) {
      cout << "Yes" << '\n';
      continue;
    }
    a -= b;
    ll diff = d - b;
    if (diff == 0) {
      cout << (a <= c ? "Yes" : "No") << '\n';
      continue;
    }
    if (diff <= b - c - 1) {
      cout << "No" << '\n';
      continue;
    }
    ll g = gcd(diff, b);
    if (g <= b - c - 1) {
      cout << "No" << '\n';
      continue;
    }
    ll cc = c + 1 - a, bb = b - 1 - a;
    cout << (cc % g && cc / g == bb / g ? "Yes" : "No") << '\n';
  }
}
