#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  long long T;
  std::cin >> T;
  long long a, b, c, d;
  for (long long i = 0; i < T; i++) {
    std::cin >> a >> b >> c >> d;
    std::string judge = "Yes";
    for (long long x = 0; x < 2000; x++) {
      if (a - b < 0) {
        judge = "No";
        break;
      }
      if (a - c >= b) {
        a -= (a - c) / b * b;
      } else {
        a -= b;
      }
      if (a <= c) {
        a += d;
      }
    }
    std::cout << judge << std::endl;
  }
  return 0;
}
