#include <bits/stdc++.h>
using namespace std;
int T;
vector<long long> A(301, 0);
vector<long long> B(301, 0);
vector<long long> C(301, 0);
vector<long long> D(301, 0);
int main(void) {
  cin >> T;
  for (int i = 0; i < T; ++i) cin >> A[i] >> B[i] >> C[i] >> D[i];
  for (int i = 0; i < T; ++i) {
    long long a = A[i], mod = 0;
    bool no = true, yes = true;
    if (A[i] < B[i])
      no = false;
    else if (B[i] <= A[i] && B[i] > D[i])
      no = false;
    else if (B[i] <= A[i] && B[i] <= D[i] && B[i] <= C[i])
      yes = false;
    else {
      while ((no = a % B[i] <= C[i]) && (yes = mod < a % B[i]))
        mod = a % B[i], a += D[i];
    }
    if (!no)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
