#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long e = a - c;
    long long f = e % b;
    long long rem = c - b + f;
    if (rem < 0) {
      cout << "No" << endl;
      continue;
    }
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    if (d == b) {
      cout << "Yes" << endl;
      continue;
    }
    double k = (double)(c - rem) / (d - b);
    double p = (double)(b - rem) / (d - b) + 0.5;
    int _k = k;
    int _p = p;
    if (c > b) {
      cout << "Yes" << endl;
      continue;
    }
    if (_p - _k >= 2)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
