#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (b > a || b > d) {
    cout << "No\n";
    return;
  }
  if (c >= b) {
    cout << "Yes\n";
    return;
  }
  long long x = (a - c) / b;
  if (x > 0) a -= x * b;
  while (a > c) a -= b;
  if (a < 0) {
    cout << "No\n";
    return;
  }
  long long y = d % b;
  for (int iter = 0; iter < 1000000; ++iter) {
    a += y;
    if (a > c) a -= b;
    if (a < 0) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) solve();
}
