#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
long long adj(long long a, long long b, long long m) {
  if (a % m > b) b += m;
  return a + b - a % m;
}
bool work() {
  long long a, b, c, d, g;
  scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
  if (b > a || b > d) return 0;
  g = gcd(b, d);
  return adj(c - b + 1, a % g, g) >= 0;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) puts(work() ? "Yes" : "No");
}
