#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
const ll INF = 1e15;
const ld eps = 1e-15;
int main() {
  ll N;
  cin >> N;
  for (int k = 0; k < N; k++) {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    bool ok = true;
    ok &= D >= B;
    if (A <= C) {
      ok &= A >= B;
    } else {
      A -= (A - min(A, C + 1)) / B * B;
      assert(A >= C + 1);
      ll now = (A - (C + 1)) % B;
      if (D % B != 0) {
        now += ((B - now + (D % B) - 1) / (D % B)) * (D % B);
        now %= B;
      }
      ok &= now + C + 1 >= B;
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
