#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
  std::copy(std::begin(c), std::end(c),
            std::ostream_iterator<typename C::value_type>(os, " "));
  os << std::endl;
}
int main() {
  int t;
  cin >> t;
  vl a(t), b(t), c(t), 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 (a[i] < b[i]) {
      cout << "No"
           << "\n";
      continue;
    }
    a[i] -= ((a[i] - c[i] + (b[i] - 1)) / b[i]) * b[i];
    ll temp = a[i];
    a[i] += d[i];
    bool ok = true;
    while (true) {
      a[i] -= max(b[i], ((a[i] - c[i] + (b[i] - 1)) / b[i]) * b[i]);
      if (a[i] < 0) {
        ok = false;
        break;
      }
      if (temp == a[i]) break;
      a[i] += d[i];
    }
    if (ok) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
  return 0;
}
