#include <bits/stdc++.h>
using namespace std;
int N = 400;
string slove(long a, long b, long c, long d) {
  for (int i = 0; i < 10000000; i++) {
    if (a < b) {
      return "No";
    }
    a = a - b;
    if (a <= c) {
      a = a + d;
    }
  }
  return "Yes";
}
int main() {
  int n;
  cin >> n;
  long a[N], b[N], c[N], d[N];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < n; i++) {
    cout << slove(a[i], b[i], c[i], d[i]) << '\n';
  }
}
