#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 (b > d) {
      able = false;
    } else {
      auto firstA = a;
      ll pa = a;
      do {
        pa = a;
        if (a < b) {
          able = false;
          break;
        }
        float target = a >= c ? a - c : b;
        a -= ll(ceil(target / b)) * b;
        if (a <= c) a += d;
      } while (firstA != a && pa != a);
    }
    cout << (able ? "Yes" : "No") << endl;
    ;
  }
}
