#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void init();
bool solve();
signed main() {
  int q;
  cin >> q;
  while (q--) {
    init();
    if ((solve())) {
      cout << ("Yes") << endl;
    } else {
      cout << "No" << endl;
    };
  }
}
ll A, B, C, D;
void init() { cin >> A >> B >> C >> D; }
ll gc(ll x, ll y) {
  if (x < y) swap(x, y);
  if (y == 0) return x;
  return gc(y, x % y);
}
bool solve() {
  if (A < B || D < B) {
    cerr << "A ";
    return false;
  }
  if (B - 1 <= C) {
    cerr << "B ";
    return true;
  }
  ll X = A - C;
  ll cnt = (X + B - 1) / B;
  A -= cnt * B;
  if (A < 0) {
    cerr << "C ";
    return false;
  }
  if (D - B == 0) {
    cerr << "D ";
    return true;
  }
  X = (D - B) % B;
  ll G = gc(X, B);
  ll amari = A % G;
  if (amari <= C + 1 - B) {
    cerr << "E ";
    return false;
  }
  ll L = (C + 1) % G;
  ll R = (B - 1) % G;
  if (L <= R) {
    cerr << "F ";
    return !(L <= amari && amari <= R);
  } else {
    cerr << "G ";
    return (R < amari && amari < L);
  }
}
