#include <bits/stdc++.h>
using namespace std;
void work() {
  long long A, B, C, D;
  unordered_set<long long> s;
  cin >> A >> B >> C >> D;
  bool ok = true;
  if (D < B || C < B)
    for (long long t1, t2; ok;) {
      if (s.count(A)) break;
      s.insert(A);
      t1 = (A - C + B - 1) / B;
      t2 = A / B;
      if (!t2 || t2 < t1) {
        ok = false;
      } else {
        A = A - t2 * B + D;
      }
    }
  else
    ok = (A >= B);
  puts(ok ? "Yes" : "No");
}
int main() {
  int n;
  cin >> n;
  while (n--) work();
  return 0;
}
