#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
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";
    } else if (C > B - 2) {
      std::cout << "Yes\n";
    } else if (D == B) {
      if (A % B < C) {
        std::cout << "Yes\n";
      } else {
        std::cout << "No\n";
      }
    } else {
      long long x = D - B;
      G = gcd(B, x);
      T = A % G;
      if (T == 0) {
        T = G;
      }
      if (C < B - T) {
        std::cout << "No\n";
      } else {
        std::cout << "Yes\n";
      }
    }
  }
  return 0;
}
