#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) {
  long long r;
  if (a < b) swap(a, b);
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << "No" << endl;
    else if (d < b)
      cout << "No" << endl;
    else if (c >= b)
      cout << "Yes" << endl;
    else {
      if (c < b + a % gcd(b, d) - gcd(b, d))
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
  return 0;
}
