#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
long long INF = 100000000000000;
long long MOD = 1e9 + 7;
int main() {
  long long N;
  cin >> N;
  vector<long 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];
  }
  vector<string> ans(N);
  for (int i = 0; i < N; i++) {
    if (B[i] > A[i]) {
      ans[i] = "No";
      continue;
    }
    if (B[i] > D[i]) {
      ans[i] = "No";
    } else if (B[i] == D[i]) {
      long long L = C[i], U = B[i];
      L -= A[i] % B[i];
      U -= A[i] % B[i];
      if (L < 0) {
        ans[i] = "No";
        continue;
      }
      ans[i] = "Yes";
    } else {
      long long L = C[i], U = B[i];
      L -= A[i] % B[i];
      U -= A[i] % B[i];
      if (L < 0) {
        ans[i] = "No";
        continue;
      }
      L++;
      long long num = L / (D[i] - B[i]);
      if (L >= U) {
        ans[i] = "Yes";
        continue;
      }
      if (L % (D[i] - B[i]) == 0) {
        ans[i] = "No";
        continue;
      }
      if ((num + 1) * (D[i] - B[i]) < U) {
        ans[i] = "No";
        continue;
      }
      ans[i] = "Yes";
    }
  }
  for (int i = 0; i < N; i++) {
    cout << ans[i] << endl;
  }
}
