#include <bits/stdc++.h>
using namespace std;
bool solve(long long A, long long B, long long C, long long D) {
  if (A < B) return false;
  if (A <= C) {
    if (B > D)
      return false;
    else if (A >= B)
      return true;
  }
  if (D < B) return false;
  if (C >= B) return true;
  if (D % B != 0 && D % B <= B - C - 1) return false;
  long long fac = D % B;
  for (long long i = 0; i < 100000; i++) {
    if (C + 1 - A > 0) {
      A += D * ((C + 1 - A) / D) % B;
    }
    A = (A + D) % B;
    if (C < A) return false;
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  vector<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];
  for (int i = 0; i < T; i++)
    cout << (solve(A[i], B[i], C[i], D[i]) ? "Yes" : "No") << endl;
  return 0;
}
