#include <bits/stdc++.h>
bool solve();
long long gcd(long long, long long);
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    if (solve())
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
bool solve() {
  long long a, b, c, d;
  scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
  if (a < b || d < b) return false;
  if (c >= b) return true;
  a %= b;
  if (a > c) return false;
  if (b == d) return true;
  d -= b;
  if (c + d < b) return false;
  long long a_start_rest{a % d},
      a_first{(c + d - a_start_rest) / d * d + a_start_rest};
  if (a_first < b) return false;
  const long long cycle_delta{(a_first - b + d - a_start_rest) % d};
  if (cycle_delta == 0) return true;
  const long long min_delta{gcd(d, cycle_delta)};
  if ((a_first - c - 1) / min_delta * min_delta + c + 1 < b)
    return false;
  else
    return true;
}
long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    std::swap(a, b);
  }
  return b;
}
