#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  long long A[T], B[T], C[T], D[T];
  for (int i = 0; i < T; ++i) cin >> A[i] >> B[i] >> C[i] >> D[i];
  long long ans[T];
  long long cnt = 0;
  for (long long i = 0; i < T; ++i) {
    if (A[i] < B[i]) {
      ans[i] = 0;
      continue;
    }
    if (D[i] - B[i] != 0)
      while (A[i] + cnt * (D[i] - B[i]) <= C[i] + B[i]) ++cnt;
    else {
      if (A[i] - B[i] > C[i])
        ans[i] = 0;
      else
        ans[i] = 1;
      continue;
    }
    if (A[i] + cnt * (D[i] - B[i]) < 2 * B[i])
      ans[i] = 0;
    else
      ans[i] = 1;
    cnt = 0;
  }
  for (long long i = 0; i < T; ++i) {
    if (ans[i] == 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
