#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
int main() {
  lint T;
  cin >> T;
  while (T--) {
    lint A, B, C, D;
    cin >> A >> B >> C >> D;
    bool c0 = (A >= B);
    bool c1 = (B <= D);
    lint ok = 0;
    lint ng = B - 1;
    while (ng - ok > 1) {
      lint mid = (ok + ng) / 2;
      lint adx = (A + (D % B * mid) % B) % B;
      (adx >= A % B ? ok : ng) = mid;
    }
    lint mx = (A + (D % B * ok) % B) % B;
    bool c2 = (mx <= C);
    cout << (c0 && c1 && c2 ? "Yes" : "No") << endl;
  }
}
