#include <bits/stdc++.h>
using namespace std;
long long GCD(long long left, long long right) {
  if (left == 0 || right == 0) return 0;
  if (left < 0) left *= -1;
  if (right < 0) right *= -1;
  if (left < right) swap(left, right);
  long long nextnum, ansgcd = -1;
  while (ansgcd == -1) {
    nextnum = left % right;
    if (nextnum == 0) ansgcd = right;
    left = right;
    right = nextnum;
  }
  return ansgcd;
}
long long LCM(long long left, long long right) {
  return left / GCD(left, right) * right;
}
long long a, b, c, d, t;
bool solve();
bool ch(long long x);
int main() {
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> a >> b >> c >> d;
    if (solve())
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
bool solve() {
  if (a < b) return 0;
  if (d < b) return 0;
  if (c < b) {
    a -= (a - c) / b * b;
    if (a >= b) a -= b;
    if (a <= c && d % b == 0)
      return 1;
    else if (d % b == 0)
      return 0;
    d %= b;
    long long g = GCD(d, c);
    a %= g;
    if (ch(a) || ch((a + g) % c) || ch((a - g + c) % c)) return 0;
  }
  return 1;
}
bool ch(long long x) { return x >= 1 && x <= b - c - 1; }
