#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
int main() {
  ll t;
  cin >> t;
  for (ll i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << '\n';
      continue;
    }
    if (b == d || d % b == 0) {
      if (a % b <= c) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      continue;
    }
    ll x = (a % b) + (d % b) * ((b - (a % b)) / (d % b) -
                                (((b - (a % b)) % (d % b) == 0) ? 1 : 0));
    if (c < x && x < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
