#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  long long a[t], b[t], c[t], d[t];
  for (long long i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    for (long long j = 0; j < 100000; j++) {
      if (a[i] > c[i]) {
        a[i] -= ((a[i] - c[i] - 1) / b[i] + 1) * b[i];
      } else
        a[i] -= b[i];
      if (a[i] < 0) {
        cout << "No" << endl;
        break;
      } else if (a[i] < c[i])
        a[i] += d[i];
      if (j == 99999) cout << "Yes" << endl;
    }
  }
  return 0;
}
