#include <bits/stdc++.h>
using namespace std;
long long dp[200][2];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = 1;
    long long i = 100000;
    while (i-- && ok) {
      if (a < b) {
        ok = 0;
        break;
      }
      long long p = (a - c + b - 1) / b;
      p = max(p, 1ll);
      a -= p * b;
      if (a < 0) ok = 0;
      if (a <= c) a += d;
    }
    if (ok)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
