#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    bool ok = true;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || b > d)
      ok = false;
    else {
      long long s;
      if (d == b) {
        a -= b;
        if (a > c)
          if (b > a) ok = false;
        if (ok)
          printf("Yes\n");
        else
          printf("No\n");
        continue;
      }
      if (a <= c) {
        long long k = (c - a) / (d - b);
        a += k * (d - b);
        s = a + d;
      } else {
        long long k = (a - c) / d;
        if ((a - c) % d == 0) k--;
        s = a - d * k;
      }
      long long g = gcd(b, d);
      long long k = (s - c) / g;
      if ((s - c) % g == 0) k--;
      if (b > s - g * k) ok = false;
    }
    if (ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
