#include <bits/stdc++.h>
using namespace std;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (long long)1e9 + 7;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
struct Edge {
  int to, cap, rev;
  Edge(int _to, int _cap, int _rev) {
    to = _to;
    cap = _cap;
    rev = _rev;
  }
};
void add_edge(vector<vector<Edge>>& G, int from, int to, int cap, bool revFlag,
              int revCap) {
  G[from].push_back(Edge(to, cap, G[to].size()));
  if (revFlag) G[to].push_back(Edge(from, revCap, G[from].size() - 1));
}
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b || b > d) {
    cout << "No" << '\n';
    return;
  }
  if (b == d) {
    if (a % b > c)
      cout << "No" << '\n';
    else
      cout << "Yes" << '\n';
    return;
  }
  long long s = a % b;
  long long r = (c - s) / (d - b);
  if (s > c || s + (d - b) * (r + 1) < b)
    cout << "No" << '\n';
  else
    cout << "Yes" << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int(i) = (int)(0); (i) < (int)(t); (i)++) solve();
  return 0;
}
