#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll t;
  cin >> t;
  for (auto i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    bool able = true;
    auto firstA = a;
    ll pa = a;
    do {
      pa = a;
      if (a < b) {
        able = false;
        break;
      }
      a -= max(ll(ceil(float(a - c) / b)), ll(1)) * b;
      if (a <= c) a += d;
    } while (firstA > a);
    cout << (able ? "Yes" : "No") << endl;
    ;
  }
}
