#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll t;
  cin >> t;
  for (auto i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    bool able = true;
    if (a < b || b > d) {
      able = false;
    } else if (b <= c || d % b == 0) {
      able = true;
    } else {
      auto min = a - (a / b) * b;
      auto nextMin = min + d % b * ceil(float(c - min) / (b % d));
      if (nextMin == c) nextMin += d % b;
      if (nextMin < b) {
        able = false;
      }
    }
    cout << (able ? "Yes" : "No") << endl;
    ;
  }
}
