#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long power(long long x, long long p, long long MOD) {
  if (p == 0) return 1 % MOD;
  if (p == 1) return x % MOD;
  long long res = power(x, p / 2, MOD);
  res = (long long)res * res % MOD;
  if (p & 1) res = (long long)res * x % MOD;
  return res;
}
long long A, B, C, D;
long long steps;
bool can(long long x) {
  if (steps > 1e5) {
    return true;
  }
  steps++;
  if (x < B) {
    return false;
  }
  long long buys = max((x - C + B - 1) / B, 1LL);
  long long rem = max(x % B, x - buys * B);
  if (rem > C) return false;
  if (D == B) return true;
  if (D < B) return false;
  return can(rem + D);
}
void solve() {
  cin >> A >> B >> C >> D;
  steps = 0;
  cout << (can(A) ? "Yes" : "No") << endl;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) solve();
}
