#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const double PI = acos(-1);
const double EPS = 1e-14;
template <class T>
using vec = vector<T>;
using ll = long long;
using ull = unsigned long long;
using vi = vec<int>;
using vl = vec<ll>;
using vd = vec<double>;
using pii = pair<int, int>;
using pdd = pair<double, double>;
using vec2 = complex<double>;
using si = set<int>;
using mii = map<int, int>;
template <class T = int>
inline T in() {
  T x;
  cin >> x;
  return x;
}
template <class T = int>
inline vec<T> in(int n) {
  vec<T> v(n);
  for (int i = (int)(0); i < (int)(n); ++i) v[i] = in<T>();
  return v;
}
template <class T = int>
inline void in(T* x, int n) {
  for (int i = (int)(0); i < (int)(n); ++i) x[i] = in<T>();
}
template <class T>
inline void print(const T& x) {
  cout << x << '\n';
}
template <class T>
inline void printd(const T& x, int d) {
  cout << fixed << setprecision(d) << x << '\n';
}
template <class T>
inline void printv(vec<T>& v) {
  int n = (v).size();
  for (int i = (int)(0); i < (int)(n); ++i) cout << v[i] << "\n "[i < n - 1];
}
template <class T>
inline void printv(vec<T>& v, int n) {
  for (int i = (int)(0); i < (int)(n); ++i) cout << v[i] << "\n "[i < n - 1];
}
template <class T>
inline void printa(T* ary, int n) {
  for (int i = (int)(0); i < (int)(n); ++i) cout << ary[i] << "\n "[i < n - 1];
}
bool can_buy_eternity(ll a, ll b, ll c, ll d) {
  if (a < b or c < a % b or d < b) {
    return false;
  }
  if (d % b == 0) {
    return true;
  }
  ll r = a % b;
  ll mod_diff = d - b;
  ll max_mod = b - 1;
  if (b % mod_diff == 0) {
    max_mod = (b - r - 1) / mod_diff * mod_diff + r;
  }
  return max_mod <= c;
}
signed main() {
  int t = in();
  for (int i = (int)(0); i < (int)(t); ++i) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    puts(can_buy_eternity(a, b, c, d) ? "Yes" : "No");
  }
  return 0;
}
