#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
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 G = gcd(B, D);
  ll AM = A % G;
  ll CM = (C + 1) % G;
  ll BM = (B - 1) % G;
  if (CM <= BM) return !(CM <= AM && AM <= BM);
  return !(AM <= BM || CM <= AM);
}
int main() {
  int Q;
  cin >> Q;
  while (Q--) {
    if (solve())
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
