#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    for (int j = 0; j < 100000; j++) {
      if (A >= C) {
        long long diff = ((A - C - 1) / B + 1) * B;
        A -= diff;
      } else {
        A -= B;
      }
      if (A < 0) {
        cout << "No" << endl;
        goto l;
      } else if (A <= C) {
        A += D;
      }
    }
    cout << "Yes" << endl;
  l:
    continue;
  }
  return 0;
}
