#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
signed main() {
  long long t;
  cin >> t;
  for (long long x = 0; x < t; x++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a)
      cout << "No" << endl;
    else if (b > d)
      cout << "No" << endl;
    else if (b <= c)
      cout << "Yes" << endl;
    else {
      long long G = gcd(b, d);
      a %= b;
      long long l = b - (G - a) % G;
      if (l == b) l -= G;
      if (l > c)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
}
