#include <bits/stdc++.h>
int main() {
  size_t T;
  std::cin >> T;
  std::vector<long long> A(T, 0), B(T, 0), C(T, 0), D(T, 0);
  for (size_t i = 0; i < T; i++) {
    std::cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (size_t i = 0; i < T; i++) {
    bool ans = false;
    if (A[i] >= B[i]) {
      if (D[i] > B[i]) {
        const long long p0 = A[i] % B[i];
        long long E = B[i], f = D[i];
        while (true) {
          long long tmp = f % E;
          if (tmp == 0) {
            break;
          }
          f = E;
          E = tmp;
        }
        ans = ((p0 % E + B[i] - E) <= C[i]);
      } else if (D[i] == B[i]) {
        ans = (A[i] - B[i] <= C[i]);
      }
    }
    std::cout << (ans ? "Yes" : "No") << std::endl;
  }
  return 0;
}
