#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T>
using vec = vector<T>;
using P = pair<ll, ll>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  fill((T *)array, (T *)(array + N), val);
}
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
signed main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ll t;
  cin >> t;
  for (ll i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (d < b || a < b) {
      cout << ("No") << endl;
      continue;
    } else if (c >= b) {
      cout << ("Yes") << endl;
      continue;
    }
    ll g = gcd(b, d);
    if (c < b - g + a % g)
      cout << ("Yes") << endl;
    else
      cout << ("No") << endl;
  }
}
