#include <bits/stdc++.h>
using namespace std;
void solve() {
  int T;
  cin >> T;
  while (T--) {
    long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (D < B || A < B) {
      cout << "NO" << endl;
      continue;
    }
    A = ((C - A % B) - 1) / B * B + A % B;
    if (C < A) {
      cout << "NO" << endl;
      continue;
    }
    if (B == D) {
      cout << "YES" << endl;
      continue;
    }
    A += ((C - A) / (D - B) + 1) * (D - B);
    cout << ((A >= B) ? "YES" : "NO") << endl;
  }
}
int main(void) {
  solve();
  return 0;
}
