#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
ll mod = 1000000007;
void yorn(bool a) {
  if (a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
ll gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  for (int i = 0; i < 1e5; i++) {
    if (a < b) {
      yorn(0);
      return;
    }
    a -= b;
    if (a > c) a -= (a - c - 1) / b * b;
    if (a > c && a < b) {
      yorn(0);
      return;
    }
    if (a > c) a -= b;
    a = a + d;
  }
  yorn(1);
}
int main() {
  ll t;
  cin >> t;
  while (t--) {
    solve();
  }
}
