#include <bits/stdc++.h>
using namespace std;
const long long T = 2007;
long long dv(long long a, long long b) {
  if (a < 0)
    return 0;
  else
    return (a + b - 1) / b;
}
bool check(long long a, long long b, long long l, long long r) {
  if (a < l) return 0;
  if (r < l) return 0;
  long long x = dv(a - r, b);
  return a - x * b >= l;
}
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  for (long long i = 0; i < T; ++i) {
    if (a < b) {
      cout << "No\n";
      return;
    }
    if (check(a, b, c + 1, b - 1)) {
      cout << "No\n";
      return;
    }
    long long w = a - c;
    long long t = max(1ll, dv(w, b));
    a -= b * t;
    a += d;
  }
  cout << "Yes\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
}
