#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b > a) swap(a, b);
  long long int r = -1;
  while (r != 0) {
    r = a % b;
    a = b, b = r;
  }
  return r;
}
int main(int argc, char const *argv[]) {
  int T;
  std::cin >> T;
  for (int i = 0; i < T; i++) {
    long long int A, B, C, D, g;
    std::cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      std::cout << "No" << '\n';
      continue;
    } else if (C >= B) {
      std::cout << "Yes" << '\n';
      continue;
    }
    g = gcd(B, D);
    if (g == 1) {
      std::cout << (B - C >= 2 ? "Yes" : "No") << '\n';
      continue;
    }
    if (A % g > C % g) {
      C += A % g - C % g;
    } else if (A % g == C % g) {
      C += g;
    } else {
    }
    std::cout << (B > C ? "No" : "Yes") << '\n';
  }
  return 0;
}
