#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T, A[300], B[300], C[300], D[300];
  cin >> T;
  for (int i = 0; i < (T); i++) {
    cin >> A[i];
    cin >> B[i];
    cin >> C[i];
    cin >> D[i];
  }
  for (int i = 0; i < (T); i++) {
    int OK = 1;
    if (A[i] < B[i]) {
      cout << "No" << endl;
      continue;
    }
    if (B[i] > D[i]) {
      cout << "No" << endl;
      continue;
    }
    if (B[i] <= C[i]) {
      cout << "Yes" << endl;
      continue;
    }
    long long saisho = B[i] + A[i] % B[i];
    long long r1 = D[i], r2 = B[i], r3, r4;
    while (r2 != 0) {
      r3 = r1;
      r4 = r2;
      r2 = r1 % r2;
      r1 = r4;
    }
    long long mendoi = (B[i] - saisho) / r4;
    if ((B[i] - saisho) % r4 == 0) {
      mendoi--;
    }
    if (mendoi != (C[i] - saisho) / r4) {
      cout << "No" << endl;
      continue;
    } else {
      cout << "Yes" << endl;
      continue;
    }
  }
  return 0;
}
