#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
long long a, b, c, d;
int main() {
  long long T;
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    long long ww = gcd(gcd(a, b), gcd(c, d));
    a /= ww, b /= ww, c /= ww, d /= ww;
    if (a < b || b > d) {
      printf("No\n");
      continue;
    }
    if (b == d || c >= b) {
      printf("Yes\n");
      continue;
    }
    a = a % b;
    if (c >= a) a = ((c - a) / b + 1) * b + a;
    if (a < b) {
      printf("No\n");
      continue;
    }
    long long e = d - b;
    long long cc = gcd(b, e);
    a = a % cc;
    if (c >= a) a = ((c - a) / cc + 1) * cc + a;
    if (b == d || a >= b)
      printf("Yes\n");
    else
      printf("No\n");
    continue;
  }
}
