#include <bits/stdc++.h>
using namespace std;
bool f() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) {
    cerr << "a" << endl;
    return false;
  }
  if (b > d) {
    cerr << "b" << endl;
    return false;
  }
  long long r;
  if (a <= c) {
    r = a;
  } else {
    long long k = (a - c) / b;
    if ((a - c) % b) {
      k++;
    }
    r = a - k * b;
  }
  cerr << r << endl;
  if (r < 0) {
    cerr << "c" << endl;
    return false;
  }
  long long t = d % b;
  if (t == 0) {
    cerr << "d" << endl;
    return true;
  }
  long long l = (c - r) / t + 1;
  cerr << t << ", " << l << ", " << r + l * t << endl;
  if (r + l * t >= b) {
    cerr << "e" << endl;
    return true;
  }
  cerr << "f" << endl;
  return false;
}
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    if (f()) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
