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