#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int tests;
  cin >> tests;
  for (int test = 0; test < tests; test++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a) {
      cout << "No" << endl;
      continue;
    }
    long long currState = a;
    bool result = true;
    int it = 0;
    while (it < 800000) {
      long long x = max(1LL, (currState - c + b - 1) / b - 1);
      currState -= b * x;
      if (currState < 0LL) {
        result = false;
        break;
      }
      if (currState <= c) currState += d;
      it++;
    }
    cout << (result ? "Yes" : "No") << endl;
  }
}
