#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vl = std::vector<long long>;
using vvl = std::vector<std::vector<long long>>;
constexpr int inf = (1 << 30) - 1;
constexpr long long INF = 1LL << 60;
inline void ios_() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
}
template <typename T>
inline T Div(const T& a, const T& b) {
  return (a + b - 1) / b;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline void finish(const T& msg) {
  std::cout << msg << std::endl;
  std::exit(0);
}
template <typename T>
long long binarySearch(long long ng, long long ok, const T& fn) {
  while (std::abs(ok - ng) > 1) {
    T mid = (ok + ng) / 2;
    if (fn(mid))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
struct ModInt {
  long long value;
  static const long long mod;
  ModInt(long long v = 0) : value(((v % mod) + mod) % mod) {}
  ModInt pow(long long n) const {
    long long x = value, res = 1;
    while (n > 0) {
      if (n & 1) {
        res = res * x % mod;
      }
      x = x * x % mod;
      n >>= 1;
    }
    return ModInt(res);
  }
  ModInt inverse() const { return pow(mod - 2); }
  ModInt operator-() const { return ModInt((mod - value) % mod); }
  ModInt& operator+=(const ModInt& a) {
    value += a.value;
    value %= mod;
    return *this;
  }
  ModInt& operator-=(const ModInt& a) {
    value += (-a).value;
    value %= mod;
    return *this;
  }
  ModInt& operator*=(const ModInt& a) {
    value *= a.value;
    value %= mod;
    return *this;
  }
  ModInt& operator/=(const ModInt& a) { return (*this) *= a.inverse(); }
  ModInt operator+(const ModInt& a) const { return ModInt(*this) += a; }
  ModInt operator-(const ModInt& a) const { return ModInt(*this) -= a; }
  ModInt operator*(const ModInt& a) const { return ModInt(*this) *= a; }
  ModInt operator/(const ModInt& a) const { return ModInt(*this) /= a; }
  bool operator==(const ModInt& a) const { return value == a.value; }
  bool operator!=(const ModInt& a) const { return value != a.value; }
  friend std::istream& operator>>(std::istream& is, ModInt& a) {
    long long v;
    is >> v;
    a = v;
    return is;
  }
  friend std::ostream& operator<<(std::ostream& os, const ModInt& a) {
    os << a.value;
    return os;
  }
  static ModInt factorial(int n) {
    static std::vector<ModInt> fact(1 << 18);
    if (fact.size() <= n) {
      fact.resize(n + 1);
    }
    if (n < 0) {
      return 0;
    }
    if (n == 0) {
      return 1;
    }
    if (fact[n] != 0) {
      return fact[n];
    }
    return fact[n] = factorial(n - 1) * n;
  }
  static ModInt combin(int n, int k) {
    if (n < 0 || k < 0 || n < k) {
      return 0;
    }
    return factorial(n) / (factorial(k) * factorial(n - k));
  }
};
const long long ModInt::mod = 1e9 + 7;
using mint = ModInt;
signed main() {
  int t;
  cin >> t;
  for (std::size_t(hoge) = 0; (hoge) < (t); (hoge)++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll s = a - b * max(1LL, Div(a - c, b));
    if (s < 0 || a < b || b > d) {
      cout << "No" << '\n';
      continue;
    }
    if (c >= b || d == b) {
      cout << "Yes" << '\n';
      continue;
    }
    ll l = c - s, u = b - s - 1;
    cout << (l / (d - b) == u / (d - b) ? "Yes" : "No") << endl;
  }
  return 0;
}
