#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  map<long long, bool> mp;
  long long rem = -1;
  while (mp.find(rem) == mp.end()) {
    mp[rem] = true;
    long long l = 1, r = a / b;
    while (l < r) {
      long long m = l + (r - l) / 2;
      if (a - (m * b) <= c) {
        r = m;
      } else {
        l = m + 1;
      }
    }
    rem = a - (l * b);
    if (rem < 0) {
      cout << "No" << endl;
      return;
    } else {
      a = rem <= c ? rem + d : rem;
    }
  }
  cout << "Yes" << endl;
  return;
}
int main() {
  int tcs;
  cin >> tcs;
  int t = 0;
  while (t < tcs) {
    solve();
    t++;
  }
  return 0;
}
