#include <bits/stdc++.h>
long long int T, A, B, C, D;
int main() {
  std::cin >> T;
  for (int loop = 0; loop < T; ++loop) {
    std::cin >> A >> B >> C >> D;
    if (A < B || B > D)
      std::cout << "No" << std::endl;
    else if (C >= B)
      std::cout << "Yes" << std::endl;
    else {
      auto start = A % B;
      auto diff = D % B;
      if (diff == 0)
        std::cout << (start <= C ? "Yes" : "No") << std::endl;
      else {
        auto low = C - start;
        auto high = B - start;
        auto res = (low / diff + 1) * diff;
        if (low < res && res < high)
          std::cout << "No" << std::endl;
        else
          std::cout << "Yes" << std::endl;
      }
    }
  }
  return 0;
}
