#include <bits/stdc++.h>
using namespace std;
const long long N = 233;
const long long INF = numeric_limits<long long>::max();
void read(long long &x) {
  x = 0;
  char ch = getchar();
  long long f = 1;
  while (!isdigit(ch)) (ch == '-' ? f = -1 : 0), ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long T, A, B, C, D;
signed main() {
  read(T);
  while (T--) {
    read(A);
    read(B);
    read(C);
    read(D);
    if (A < B) {
      printf("No\n");
      continue;
    }
    long long k = max((A - C) / B, 0ll);
    A -= k * B;
    if (A - B <= C && A >= B) A -= B;
    if (A > C || B > D) {
      printf("No\n");
      continue;
    }
    if (B == D) {
      printf("Yes\n");
      continue;
    }
    long long ok = 0;
    long long i = 0;
    while (!ok && i <= 600000) {
      ++i;
      long long l = ((C - A) / (D - B));
      long long r = ((B - A) / (D - B));
      if ((B - A) % (D - B)) ++r;
      if (l < r - 1) {
        A += (l + 1) * (D - B);
        if (A >= B)
          A -= B;
        else {
          ok = 0;
          break;
        }
      } else
        ok |= 1;
    }
    if (ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
