#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 + 99);
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T mpow(T a, T n) {
  T res = 1;
  for (; n; n >>= 1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}
signed main() {
  int t;
  cin >> t;
  while (t--) {
    ll a, b, c, d, g;
    cin >> a >> b >> c >> d;
    g = gcd(b, d);
    if (d < b) {
      cout << "No" << endl;
    } else if (a - g * ((a - c - 1) / g) < b) {
      cout << a - g * ((a - c - 1) / g) << endl;
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
