#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0) {
    return a;
  } else {
    return GCD(b, a % b);
  }
}
int main() {
  long long T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << endl;
      continue;
    } else if (b - 1 <= c) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = GCD(b, d);
    long long k;
    if ((c - a) % g == 0) {
      k = (c - a) / g;
      k++;
    } else {
      k = (c - a + g - 1) / g;
    }
    long long test = a + g * k;
    if (test < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
