#include <bits/stdc++.h>
using namespace std;
void yes() { cout << "Yes\n"; }
void no() { cout << "No\n"; }
const int ITER = 5e5;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b || d < b) return no();
  if (c >= b) return yes();
  long long delta = d - b;
  for (int(i) = 0; (i) < (ITER); ++(i)) {
    if (a < b) return no();
    if (a > c) {
      long long x = a / b, y = (a - c - 1) / b;
      if (x <= y) return no();
      long long k = (a - c + b - 1) / b;
      a -= k * b;
      a += d;
    } else {
      long long k = (c - a + delta) / delta;
      a += k * delta;
    }
  }
  return yes();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
