#include <bits/stdc++.h>
using namespace std;
namespace SHENZHEBEI {
inline char gc() { return getchar(); }
inline long long read() {
  long long x = 0, f = 1;
  char ch = gc();
  for (; !isdigit(ch); ch = gc())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = gc()) x = x * 10 - 48 + ch;
  return x * f;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline char readchar() {
  char ch = gc();
  for (; isspace(ch); ch = gc())
    ;
  return ch;
}
inline long long readstr(char *s) {
  char ch = gc();
  int cur = 0;
  for (; isspace(ch); ch = gc())
    ;
  for (; !isspace(ch); ch = gc()) s[cur++] = ch;
  s[cur] = '\0';
  return cur;
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline double getreal() {
  static double lbc;
  scanf("%lf", &lbc);
  return lbc;
}
}  // namespace SHENZHEBEI
using namespace SHENZHEBEI;
const long long N = 1000;
long long A, B, C, D;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void work() {
  A = read(), B = read(), C = read(), D = read();
  if ((B > D) || (A < B)) return puts("No"), void(0);
  long long d = gcd(B, D);
  if (A >= C) A -= (A - C) / d * d;
  for (; A > C; A -= d)
    ;
  for (; A <= C; A += d)
    ;
  if (A < B)
    puts("No");
  else
    puts("Yes");
}
int main() {
  for (long long T = read(); T--;) work();
}
