#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;
long long gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); }
void solve(long long x, long long y, long long z, long long K) {
  long long t = gcd(y, z);
  long long k = x / t;
  long long tmp = x - k * t;
  if (tmp > 0) tmp -= t;
  long long tt = z - t + tmp;
  if (tt > K)
    printf("No\n");
  else
    printf("Yes\n");
}
signed main() {
  read(T);
  long long g = 1;
  while (T--) {
    if (g == 50) {
      ++g;
      --g;
    }
    read(A);
    read(B);
    read(C);
    read(D);
    if (A < B) {
      printf("No\n");
      continue;
    }
    if (B == D || C >= B) {
      printf("Yes\n");
      continue;
    }
    A %= B;
    solve(A, D - B, B, C);
  }
  return 0;
}
