#include <bits/stdc++.h>
using namespace std;
bool hanntei(long int a, long int b, long int c, long int d) {
  bool retval = true;
  long int currentStock = a;
  long int loopFlg = 0;
  long int loopMax = max(b, c);
  while (loopFlg < loopMax) {
    currentStock = min(currentStock % b, currentStock - b);
    if (currentStock < 0) {
      retval = false;
      break;
    }
    if (currentStock <= c) {
      currentStock += d;
      loopFlg++;
    }
  }
  return retval;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (hanntei(a, b, c, d)) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
