#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll x, ll y) {
  while (y) {
    ll r = x % r;
    x = y;
    y = r;
  }
  return x;
}
bool solve() {
  ll A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A < B || B > D) {
    return false;
  }
  if (B <= C) {
    return true;
  }
  if (A % B > C) {
    return false;
  }
  ll d = gcd(B, D);
  ll i = (C - A % B) / d + 1;
  return A % B + i * d >= B;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    cout << (solve() ? "Yes" : "No") << '\n';
  }
  cout << flush;
  return 0;
}
