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