#include <bits/stdc++.h>
uint64_t gcd(uint64_t b, uint64_t d) {
  if (b < d) return gcd(d, b);
  if (b % d) return gcd(d, b % d);
  return d;
}
int main() {
  uint64_t A, B, C, D;
  int T;
  std::cin >> T;
  for (int i = 0; i < T; ++i) {
    std::cin >> A >> B >> C >> D;
    auto m = A % B + (B - A % B) / gcd(B, D) * gcd(B, D);
    if (B > D || A % B > C || C + gcd(B, D) < B)
      std::cout << "No" << std::endl;
    else
      std::cout << "Yes" << std::endl;
  }
  return 0;
}
