#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  cout << endl;
  for (int i = 0; i < T; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = true;
    if (a < b) ok = false;
    if (b > c || b > d) {
      a -= (long long)floor(1.0 * (a - c) / b) * b;
      if (a == c) a += b;
      if (a - b < 0) ok = false;
      long long diff = d - b;
      if (diff < 0) ok = false;
      long long next =
          a - b + (long long)ceil(1.0 * (c - (a - b)) / diff) * diff;
      if (next == c && next + diff < b)
        ok = false;
      else if (next > c && next < b)
        ok = false;
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
