#include <bits/stdc++.h>
using namespace std;
string solve(long long count, long long a, long long b, long long c,
             long long d) {
  if (a < b) {
    return "No";
  }
  long long k = (a - c) / b + ((a - c) % b != 0);
  k = max(k, 1LL);
  if (a - k * b < 0) {
    return "No";
  }
  if (count == 73000) {
    return "Yes";
  }
  return solve(count + 1, a - k * b + d, b, c, d);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << solve(0, a, b, c, d) << endl;
  }
}
