#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a / b > 0)
    a = a % b + b;
  else
    a = a % b;
  set<long long> pres;
  while (pres.find(a) == pres.end()) {
    pres.insert(a);
    long long night = a - b;
    if (night < 0) {
      cout << "No" << endl;
      return;
    } else if (night <= c) {
      a = night + d;
    } else
      a = night;
    if (a / b > 0)
      a = a % b + b;
    else
      a = a % b;
  }
  cout << "Yes" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
