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