#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
long long t, a, b, c, d;
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
    } else if (d < b) {
      cout << "No" << endl;
    } else if (c >= b) {
      cout << "Yes" << endl;
    } else {
      if (d % b == 0) {
        if (a % b > c) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else if ((a % b + (d % b) * ((c - a % b) / (d % b) + 1)) % b > c) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
}
