#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n], b[n], c[n], d[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] < b[i]) {
      cout << "No" << endl;
      continue;
    } else {
      if (b[i] <= c[i] && b[i] <= d[i]) {
        cout << "Yes" << endl;
        continue;
      }
      if (b[i] <= c[i] && b[i] > d[i]) {
        cout << "No" << endl;
        continue;
      }
      if (b[i] > d[i]) {
        cout << "No" << endl;
        continue;
      }
      if (a[i] % b[i] > c[i] && a[i] % b[i] < b[i]) {
        cout << "No" << endl;
        continue;
      }
      long long aa = a[i] % b[i];
      long long bb = d[i] % b[i];
      if (bb == 0) {
        cout << "Yes" << endl;
        continue;
      }
      long long ci = c[i] - aa;
      long long bi = b[i] - aa;
      aa = ci - ci % bb;
      while (1) {
        aa += bb;
        if (aa > ci && aa < bi) {
          cout << "No" << endl;
          break;
        }
        if (aa >= bi) {
          cout << "Yes" << endl;
          break;
        }
      }
    }
  }
  return 0;
}
