#include <bits/stdc++.h>
using namespace std;
bool binary_search(vector<long long> v, long long x) {
  sort(v.begin(), v.end());
  auto it = lower_bound(v.begin(), v.end(), x);
  if (*it == x)
    return true;
  else
    return false;
}
int main() {
  long long T;
  cin >> T;
  vector<long long> a(T);
  vector<long long> b(T);
  vector<long long> c(T);
  vector<long long> d(T);
  for (int i = 0; i < T; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < T; i++) {
    if (c[i] < b[i]) {
      long long rest = a[i];
      vector<long long> v;
      v.push_back(rest);
      while (true) {
        rest -= b[i];
        v.push_back(rest);
        if (rest > c[i]) {
          long long x = rest - c[i];
          rest -= ((x + b[i] - 1) / b[i] * b[i]);
          v.push_back(rest);
        }
        if (rest < 0) {
          cout << "No";
          break;
        }
        if (rest <= c[i]) {
          rest += d[i];
        }
        if (binary_search(v, rest)) {
          cout << "Yes";
          break;
        }
        if ((rest > c[i]) && (rest < b[i])) {
          cout << "No";
          break;
        }
        v.push_back(rest);
      }
    } else {
      if (a[i] < b[i]) {
        cout << "No" << endl;
        continue;
      }
      if (b[i] > d[i]) {
        cout << "No";
      } else {
        cout << "Yes";
      }
    }
    cout << endl;
  }
  return 0;
}
