#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
long long extGCD(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extGCD(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
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;
    bool subflag = false;
    long long k = A[i] % B[i];
    long long x, y;
    long long g = GCD(B[i], D[i]);
    if (B[i] > A[i]) flag = false;
    if (B[i] > D[i]) flag = false;
    if (flag == true && C[i] >= B[i]) {
      subflag = true;
    }
    if (flag == true && subflag == false) {
      for (long long j = 0; j < B[i]; j++) {
        if ((A[i] + g * j) % B[i] > C[i]) flag = false;
      }
    }
    if (flag == true)
      cout << "Yes" << endl;
    else {
      cout << "No" << endl;
    }
  }
  return 0;
}
