#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  int count = 0;
  long long A[T], B[T], C[T], D[T];
  for (long long i = 0; i < T; i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (long long i = 0; i < T; i++) {
    bool flag = true;
    long long k = A[i] % B[i];
    while (k <= C[i]) {
      k += D[i] - B[i];
    }
    if ((k % B[i]) - C[i] > 0) {
      flag = false;
    }
    bool subflag = false;
    if (flag == true) {
      while (k != (A[i] % B[i]) && flag == true && subflag == false) {
        count++;
        if (count > 10) {
          subflag = true;
        }
        while (k <= C[i]) {
          k += D[i] - B[i];
        }
        k = (k % B[i]);
        if (k > C[i]) {
          flag = false;
        }
      }
    }
    if (flag == true)
      cout << "Yes" << endl;
    else {
      cout << "No" << endl;
    }
  }
  return 0;
}
