#include <bits/stdc++.h>
using namespace std;
string judge(long int A, long int B, long int C, long int D) {
  long int temp = A;
  if (B > A)
    return "No";
  else if (B > D)
    return "No";
  else if (C >= B)
    return "Yes";
  else {
    for (long int i = 0; i <= B; i++) {
      temp += D;
      temp %= B;
      if (temp > C) return "No";
    }
    return "Yes";
  }
}
int main() {
  int T;
  cin >> T;
  long int A[T], B[T], C[T], D[T], S[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 << judge(A[i], B[i], C[i], D[i]) << endl;
  }
}
