#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p) {
  out << "(" << p.first << ", " << p.second << ")";
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "[";
  for (int i = (int)(0); i < (int)(v.size()); i++) {
    if (i > 0) out << ", ";
    out << v[i];
  }
  out << "]";
  return out;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main(int argc, char *argv[]) {
  int T;
  long long A, B, C, D;
  cin >> T;
  for (int t = (int)(0); t < (int)(T); t++) {
    cin >> A >> B >> C >> D;
    if (D < B) {
      cout << "No" << endl;
    } else if (B <= C) {
      cout << "Yes" << endl;
    } else {
      long long d = gcd(B, D);
      long long p = (C - A) / d * d;
      while (p <= C - A) {
        p += d;
      }
      if (p < B - A) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
