#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A < B) {
    cout << "No" << endl;
    return;
  }
  set<long long> s;
  long long rem = A;
  int cnt = 0;
  while (true) {
    if (A < B) {
      cout << "No" << endl;
      return;
    }
    long long k = max(0LL, (A - C) / B);
    A -= B * k;
    if (A > C && A < B) {
      cout << "No" << endl;
      return;
    }
    A -= B;
    if (A <= C) A += D;
    cnt++;
    if (cnt == 1000000) break;
  }
  cout << "Yes" << endl;
  return;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) solve();
}
