#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  for (; c < 48 || c > 57; c = getchar())
    if (c == '-') f = -1;
  for (; c > 47 && c < 58; c = getchar()) x = x * 10 + c - 48;
  return x * f;
}
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int check(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) return 0;
  if (c >= b - 1) return 1;
  a %= b;
  d %= b;
  long long t = b - (c + 1);
  if (a > c) return 0;
  long long g = gcd(b, d);
  long long x = c + 1 - a, y = b - 1 - a;
  if (x % g == 0 || x / g * g + g <= y) return 0;
  return 1;
}
int main() {
  freopen("b.out", "w", stdout);
  int t = read();
  while (t--) {
    long long a = read(), b = read(), c = read(), d = read();
    puts(check(a, b, c, d) ? "Yes" : "No");
  }
  return 0;
}
