#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926535897932;
const double EPS = 1e-9;
const long long MOD = 1000000007;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
long long a, b, c, d;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
void solve() {
  cin >> a >> b >> c >> d;
  if (a <= b) {
    cout << "No" << endl;
    return;
  }
  if (b > d) {
    cout << "No" << endl;
    return;
  }
  if (c >= b) {
    cout << "Yes" << endl;
    return;
  }
  long long g = gcd(b, d);
  if (b - g + a % g > c)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (int)t; i++) solve();
}
