#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
template <typename T>
using v = vector<T>;
const long long inf = 4611686018427387903;
void read() {}
template <typename Arg, typename... Args>
void read(Arg& arg, Args&... args) {
  cin >> (arg);
  read(args...);
}
void print() {}
template <typename Arg, typename... Args>
void print(Arg arg, Args... args) {
  cout << (arg) << " ";
  print(args...);
}
void debug() { cout << endl; }
template <typename Arg, typename... Args>
void debug(Arg arg, Args... args) {
  cout << (arg) << " ";
  debug(args...);
}
long long getInt() {
  long long a;
  cin >> a;
  return a;
}
long long gcd(long long a, long long b) {
  if (min(a, b) != 0)
    return gcd(min(a, b), max(a, b) % min(a, b));
  else
    return max(a, b);
}
void run() {
  long long t;
  cin >> t;
  for (; t; t--) {
    long long a, b, c, d;
    read(a, b, c, d);
    if (a < b || b > d)
      cout << "No";
    else {
      long long g = gcd(b, d);
      b /= g;
      d /= g;
      long long ap = a / g, cp = c / g;
      long long ar = a % g, cr = c % g;
      long long needToRemove = ap - cp + (ar > cr);
      long long daysNeeded = needToRemove / b + !!(needToRemove % b);
      long long willRemove = daysNeeded * b;
      if ((cp + 1) % b == 0 && ap >= willRemove)
        cout << "Yes";
      else
        cout << "No";
    }
    cout << '\n';
  }
}
int32_t main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(15);
  run();
  return 0;
}
