#include <bits/stdc++.h>
using namespace std;
long long gcd(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
int main() {
  long long T;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A - B < 0) {
      cout << "No" << endl;
      continue;
    }
    if (B - D > 0) {
      cout << "No" << endl;
      continue;
    }
    if (B <= C) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = gcd(B, D);
    if (B - g + (A % g) > C) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
