#include<bits/stdc++.h>
using namespace std;
using ll = long long;

bool solve() {
  ll A, B, C, D; cin >> A >> B >> C >> D;
  if (A < B) return false;
  A -= A / B * B;
  if (B > D) return false;
  if (A > C) return false;
  if (B <= C+1) return true;
  if (B == D) return true;
  ll L = B - C - 1;
  if (D - B <= L) return false;
  ll G = __gcd(B, D);
  ll AM = A % G;
  ll CM = (C+1) % G;
  ll BM = (B-1) % G;
  if (CM > BM) swap(CM, BM);
  return !(CM <= AM && AM <= BM);
}

int main() {
  int Q; cin >> Q;
  while (Q--) {
    if (solve()) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}