#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 (B == D)
        std::cout << "Yes" << std::endl;
      else {
        auto a1 = A;
        auto b1 = A - (A - C) / B * B - B;
        auto a2 = b1 + (C - b1) / (D - B) * (D - B) + (D - B);
        if (a2 == C) a2 += D - B;
        auto b_a2 = a2 + B;
        auto num = (b_a2 - a1) / (D - B) + 1;
        auto a_d = a2 - a1;
        if (a_d >= 0)
          std::cout << "Yes" << std::endl;
        else if (a1 == b_a2)
          std::cout << "Yes" << std::endl;
        else {
          auto tmp = a1 - (D - B);
          if ((a1 - b_a2) * a_d < 0)
            std::cout << "No" << std::endl;
          else {
            auto foo = b_a2 - (b_a2 - a1) / abs(a_d) * abs(a_d);
            if (foo == b_a2)
              std::cout << "No" << std::endl;
            else {
              if (abs(foo - a1) % (-a_d) != 0)
                std::cout << "No" << std::endl;
              else {
                if (foo - (D - B) * (num - 1) > 0)
                  std::cout << "Yes" << std::endl;
                else
                  std::cout << "No" << std::endl;
              }
            }
          }
        }
      }
    }
  }
  return 0;
}
