#include <bits/stdc++.h>
int n;
long long a, b, c, d;
long long gcd(long long m, long long n) {
  int r = m % n;
  return (r == 0) ? n : gcd(n, r);
}
int main() {
  scanf("%d", &n);
  while (n--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      puts("No");
      continue;
    }
    if (b > d) {
      puts("No");
      continue;
    }
    if (c + 1 >= b) {
      puts("Yes");
      continue;
    }
    long long g = gcd(b, d);
    if ((a - c - 1ll) / g - (a - b) / g > 0)
      puts("No\n");
    else
      puts("Yes\n");
  }
}
