#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x * f;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  long long a, b, c, d, x, y, z;
  t = read();
  for (register int i = 1; i <= t; i++) {
    a = read(), b = read(), c = read(), d = read();
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    x = gcd(b, d);
    y = a % b;
    if (c < y && y < b) {
      printf("No\n");
      continue;
    }
    c = (c - y);
    b = (b - y);
    z = (b / x) * x;
    if (c < z && z < b)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
