#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long out = 0, fh = 1;
  char jp = getchar();
  while ((jp > '9' || jp < '0') && jp != '-') jp = getchar();
  if (jp == '-') {
    fh = -1;
    jp = getchar();
  }
  while (jp >= '0' && jp <= '9') {
    out = out * 10 + jp - '0';
    jp = getchar();
  }
  return out * fh;
}
long long gcd(long long a, long long b) {
  return a % b == 0 ? b : gcd(b, a % b);
}
long long solve(long long a, long long b, long long m) {
  if ((a % m + m) % m > b) b += m;
  return a + b - (a % m + m) % m;
}
int judge(long long a, long long b, long long c, long long d) {
  if (b > a || b > d) return 0;
  int GCD = gcd(b, d);
  return solve(c - b + 1, a % GCD, GCD) >= 0;
}
int main() {
  int T = read();
  while (T--) {
    long long a = read(), b = read(), c = read(), d = read();
    if (judge(a, b, c, d))
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
