import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

bool test (long a, long b, long c, long d) {
  if (a < b) return false;
  if (b > d) return false;
  long delta = d - b;
  a -= b;
  long iceil (long x, long y) {
    long k = x / y;
    if (x % y) ++k;
    return k;
  }

  //minimize k >= 0: (a - k * B) <= C
  //minimize k >= 0: a - c <= k * B
  if (a > c) {
    a -= iceil (a - c, b) * b;
  }
  if (a < 0) return false;
  if (!delta) return true;
  if (c >= b) return true;
  bool[long] h;
  while (true) {
    if (a in h) return true;
    h[a] = true;
    a += iceil (c + 1 - a, delta) * delta; 
    a -= iceil (a - c, b) * b;
    if (a < 0) return false;
  }
}

void main() {
  int nt;
  readf (" %d", &nt);
  foreach (t; 0 .. nt) {
    long a, b, c, d;
    readf (" %d %d %d %d", &a, &b, &c, &d);
    writeln (test (a, b, c, d) ? "Yes" : "No");
  }
}
