#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;
template <class T>
void vin(vector<T>& v, int n) {
  v.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
}
int main() {
  int t;
  cin >> t;
  for (int(i) = (0); (i) < (long long)(t); ++(i)) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b or b > d) {
      cout << "No" << endl;
      continue;
    }
    ll n = (a - c) / b;
    if (a - b * n > c) n++;
    if (a - b * n < 0LL) {
      cout << "No" << endl;
      continue;
    }
    bool ok = true;
    for (int(i) = (0); (i) < (long long)(500000); ++(i)) {
      if (a < b) {
        ok = false;
        break;
      }
      ll n = max(1LL, (a - c) / b);
      if (a - b * n > c) n++;
      a -= b * n;
      if (a < 0LL) {
        ok = false;
        break;
      } else if (a <= c) {
        a += d;
      }
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
}
