#include <bits/stdc++.h>
using namespace std;
using i64 = long long int;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    i64 a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    i64 stock = a;
    set<i64> st;
    bool ok = false;
    while (true) {
      stock -= (stock - c - 1) / b * b;
      if (stock < b) break;
      if (st.count(stock)) {
        ok = true;
        break;
      }
      st.insert(stock);
      stock -= b;
      if (stock <= c) stock += d;
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
