#include <bits/stdc++.h>
using namespace std;
bool calc(int64_t a, int64_t b, int64_t c, int64_t d) {
  if (a < b || b > d) {
    return false;
  }
  if (b <= c && b <= d) {
    return true;
  }
  std::unordered_set<int64_t> stop_markers;
  int64_t stock = a;
  while (stock >= b) {
    int64_t const threshold = std::max(b, c - b + 1);
    if (stock >= threshold) {
      int64_t const n = (stock - threshold) / b * b;
      stock -= std::max(b, n);
    } else {
      stock -= b;
    }
    for (auto&& stop_marker : stop_markers) {
      if (stop_marker == stock) {
        return true;
      }
      if (stop_marker < stock && ((stock - stop_marker) % b) == 0) {
        return true;
      }
    }
    stop_markers.insert(stock);
    if (stock <= c) {
      if (stock == 0) {
        return true;
      }
      stock += d;
    }
  }
  return false;
}
int main() {
  int32_t t;
  std::cin >> t;
  for (int i = 0; i < t; ++i) {
    int64_t a, b, c, d;
    std::cin >> a >> b >> c >> d;
    std::cout << (calc(a, b, c, d) ? "Yes" : "No") << std::endl;
  }
  return 0;
}
