#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    []() {
      ll a, b, c, d;
      cin >> a >> b >> c >> d;
      if (a < b || d < b) {
        cout << "No" << endl;
        return;
      }
      ll g = gcd(b, d);
      ll lo = 0, hi = b;
      while (hi - lo > 1) {
        ll mid = lo + (hi - lo) / 2;
        if (a % b + g * mid >= b)
          hi = mid;
        else
          lo = mid;
      }
      ll le = a % b + lo * g;
      ll ri = c;
      if (le > ri)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }();
  }
  return 0;
}
