#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int T;
  cin >> T;
  while (T--) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
    } else if (c >= b) {
      cout << "Yes" << endl;
    } else {
      if (a >= c + 1) {
        const ll t = a - (a - c - 1) / b * b;
        if (c < t && t < b) {
          cout << "No" << endl;
          continue;
        }
      }
      if (d == b) {
        cout << "Yes" << endl;
        continue;
      }
      ll t = (a < c ? a - b : a - (a - c + b - 1) / b * b);
      t += (c + 1 - t + (d - b) - 1) / (d - b) * (d - b);
      if (c < t && t < b) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
}
