#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
long long gcd(long long x, long long y) {
  if (!y) return x;
  return gcd(y, x % y);
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    if (c >= b) {
      printf("Yes\n");
      continue;
    }
    a %= b;
    long long l = c - a, r = b - a;
    long long x = gcd(b, d);
    if (floor(1.0 * r / x) == 1.0 * r / x)
      r = r / x - 1ll;
    else
      r = 1.0 * floor(1.0 * r / x);
    if (ceil(1.0 * l / x) == 1.0 * l / x)
      l = l / x + 1ll;
    else
      l = 1.0 * ceil(1.0 * l / x);
    if (r - l + 1 >= 1)
      printf("No\n");
    else
      printf("Yes\n");
  }
}
