#include <bits/stdc++.h>
using namespace std;
void pok() { cout << "Yes" << endl; }
void png() { cout << "No" << endl; }
bool check(long a, long b, long c, long d) {
  if (a < b) return false;
  a -= b;
  a -= ((a - c) / b) * b;
  long inc = d - b;
  if (inc < 0)
    return false;
  else if (inc == 0) {
    return (a <= c);
  } else {
    a += ((c - a) / inc) * inc;
    if (a <= c) a += inc;
    return (a >= b);
  }
}
int main() {
  long T, a, b, c, d;
  cin >> T;
  for (long i = 0; i < T; i++) {
    cin >> a >> b >> c >> d;
    if (check(a, b, c, d)) {
      pok();
    } else {
      png();
    }
  }
}
