#include <bits/stdc++.h>
signed main() {
  long long t;
  std::cin >> t;
  for (long long tt = 0; tt < (t); tt++) {
    long long a, b, c, d;
    std::cin >> a >> b >> c >> d;
    if (b > d)
      std::cout << ("No") << '\n';
    else if (a < b)
      std::cout << ("No") << '\n';
    else if (a % b > c)
      std::cout << ("No") << '\n';
    else if (d % b == 0)
      std::cout << ("Yes") << '\n';
    else if (c >= b)
      std::cout << ("Yes") << '\n';
    else if (d % b <= b - c) {
      ;
      ;
      if (d % b == b - c && (a % b) % (b - c) == 0 && b % (b - c) == 0)
        std::cout << ("Yes") << '\n';
      else
        std::cout << ("No") << '\n';
    } else
      std::cout << ("Yes") << '\n';
  }
  return 0;
}
