#include <bits/stdc++.h>
long long gcd(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
int main() {
  int i, N;
  std::cin >> N;
  long long A, B, C, D, G, T;
  for (i = 0; i < N; i++) {
    std::cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      std::cout << "No\n" << std::endl;
    } else if (C > B - 2) {
      std::cout << "Yes\n" << std::endl;
    } else {
      G = gcd(B, (D - B));
      T = A % G;
      if (T == 0) {
        T = G;
      }
      if (C < B - T) {
        std::cout << "No\n" << std::endl;
      } else {
        std::cout << "Yes\n" << std::endl;
      }
    }
  }
  return 0;
}
