#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline bool chmax(A &a, B b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename A, typename B>
inline bool chmin(A &a, B b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll << 30;
constexpr ll longINF = 1ll << 60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
ll f(ll A, ll B, ll X, ll Z) {
  if (A < Z) return A + ((Z - A) / X + 1) * X;
  return A - (A - Z + B - 1) / B * B;
}
bool solve(ll A, ll B, ll C, ll D) {
  ll Z = B + C, X = D - B;
  if (X < 0) return false;
  vector<ll> v;
  if (A >= Z) {
    A = f(A, B, X, Z);
    v.emplace_back(A);
  }
  if (A < B) return false;
  if (X == 0) return true;
  for (int i = (0); i < (100000); ++i) {
    A = f(A, B, X, Z);
    A = f(A, B, X, Z);
    if (A < B) return false;
    v.emplace_back(A);
  }
  set<ll> ss;
  for (ll u : v) ss.insert(u);
  return ss.size() < v.size();
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    puts(solve(A, B, C, D) ? "Yes" : "No");
  }
  return 0;
}
