#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& x : vec) {
    is >> x;
  }
  return is;
}
int main() {
  long long ans = 0;
  long long tmp;
  int n;
  cin >> n;
  long long a, b, c, d;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    long long up = 0, dw = 0;
    if (d > b) {
      up = (c + 1 - (a % b) + d - b - 1) / (d - b);
      dw = (b - 1 - (a % b)) / (d - b);
    }
    if (a >= b && b < d && up > dw)
      cout << "Yes" << endl;
    else if (a >= b && b == d && a % b <= c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
