#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) {
      able = true;
    } else {
      auto min = a - (a / b) * b;
      auto firstMin = min;
      do {
        auto nextMin = min + d % b;
        if (nextMin > c) nextMin -= b;
        if (nextMin < 0) {
          able = false;
          break;
        }
        min = nextMin;
      } while (min > firstMin);
    }
    cout << (able ? "Yes" : "No") << endl;
    ;
  }
}
