#include <bits/stdc++.h>
using namespace std;
long long x, y;
inline long long read() {
  char ch = getchar();
  long long ans = 0;
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch <= '9' && ch >= '0') ans = ans * 10 + ch - 48, ch = getchar();
  return ans;
}
int gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int cas = read();
  while (cas--) {
    long long a = read(), b = read(), c = read(), d = read();
    if (a < b || d < b) {
      puts("No");
      continue;
    }
    if (c >= b) {
      puts("Yes");
      continue;
    }
    long long x = gcd(b, (d - b) % b);
    if (a % x - c + (b - a % x - 1) / x * x > 0)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
