#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  vector<long long> a(t, 0);
  vector<long long> b(t, 0);
  vector<long long> c(t, 0);
  vector<long long> d(t, 0);
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < t; i++) {
    if (a[i] < b[i]) {
      cout << "No" << endl;
      continue;
    }
    if (b[i] > d[i]) {
      cout << "No" << endl;
      continue;
    }
    if (a[i] % b[i] > c[i]) {
      cout << "No" << endl;
      continue;
    }
    if (b[i] == d[i]) {
      cout << "Yes" << endl;
      continue;
    }
    long long hoge = a[i] % b[i];
    long long tmp = ((c[i] - hoge) / (d[i] - b[i]) + 1) * (d[i] - b[i]);
    if (tmp + hoge >= b[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
