#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long t = 0;
  while (b) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
int main(void) {
  long long i, j, k, n, ans = 0, t;
  scanf("%lld", &t);
  for (k = 0; k < t; ++k) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b) {
      printf("No\n");
      continue;
    }
    long long max = b - 1, min = c + 1;
    a %= b;
    long long t = (c - a) / b;
    if (a > c) {
      printf("No\n");
      continue;
    }
    a += t * b;
    t = d - b;
    if (t < 0) {
      printf("No\n");
      continue;
    }
    long long tm;
    if (t) {
      tm = (c - a) / t + 1;
      a += tm * t;
    } else {
      printf("Yes\n");
      continue;
    }
    if (a < b) {
      printf("No\n");
      continue;
    }
    if (max <= min) {
      printf("Yes\n");
      continue;
    }
    max -= c;
    a -= c;
    long long de = b - b / t * t;
    long long gc = gcd(de, b);
    if (gc > max)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
