#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
bool isMugen(ll A, ll B, ll C, ll D) {
  if (A < B) {
    return false;
  }
  if (D < B) {
    return false;
  }
  if (C >= B) {
    return true;
  }
  ll E = A % B;
  ll F = D % B;
  if (C < E) {
    return false;
  }
  if (F == 0) {
    return true;
  }
  ll n = (C - E) / F;
  ll G = E + n * F;
  for (int i = 0; i < B; ++i) {
    if (C < G) {
      break;
    }
    n++;
    G = E + n * F;
  }
  if (G < B) {
    return false;
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  ll A[300];
  ll B[300];
  ll C[300];
  ll D[300];
  for (int i = 0; i < T; ++i) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = 0; i < T; ++i) {
    if (isMugen(A[i], B[i], C[i], D[i])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
