#include <bits/stdc++.h>
const long long N = 400200;
const long long Q = N * 30;
const long long mod = 1e9 + 7;
const long long MAGIC = 30;
using namespace std;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b || d < b) {
    cout << "No"
         << "\n";
  } else {
    d -= b;
    for (int i = 0; i < 2000000; i++) {
      if (a <= c) {
        long long g = (c - a) / d;
        g = max(1ll, g);
        a += g * d;
      } else {
        long long g = (a - c) / b;
        g = max(1ll, g);
        a -= g * b;
      }
      if (a < 0) {
        cout << "No"
             << "\n";
        return;
      }
    }
    cout << "Yes"
         << "\n";
  }
}
bool mtest = true;
int main() {
  ios_base::sync_with_stdio(0);
  int TE = 1;
  if (mtest) cin >> TE;
  while (TE--) solve();
  return 0;
}
