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