#include <bits/stdc++.h>
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 575;
int T;
long long A[MAX_N], B[MAX_N], C[MAX_N], D[MAX_N];
bool solve(long long tmp, int i) {
  long long divisor = D[i] % B[i];
  long long j = C[i];
  long long res = j;
  while (j < C[i] * 2) {
    j++;
    if (divisor == 0) {
      return true;
    } else {
      if ((res = (j - tmp)) % divisor == 0) {
        if (res > C[i])
          break;
        else
          continue;
      }
    }
  }
  return !(res < B[i]);
}
int main() {
  cin >> T;
  for (long long i = (long long)0; i < (long long)T; ++i) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (long long i = (long long)0; i < (long long)T; ++i) {
    if (A[i] < B[i]) {
      cout << (false ? "Yes" : "No") << endl;
      ;
      continue;
    }
    if (B[i] > D[i]) {
      cout << (false ? "Yes" : "No") << endl;
      ;
      continue;
    }
    long long tmp = A[i] % B[i];
    if (tmp > C[i]) {
      cout << (false ? "Yes" : "No") << endl;
      ;
      continue;
    }
    cout << (solve(tmp, i) ? "Yes" : "No") << endl;
    ;
  }
  return 0;
}
