#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
template <class T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
void dump_func() {}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
  cerr << head;
  if (sizeof...(Tail) == 0) {
    cerr << " ";
  } else {
    cerr << ", ";
  }
  dump_func(std::move(tail)...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  os << "{";
  for (int i = 0; i < ((int)(vec).size()); i++) {
    os << vec[i] << (i + 1 == ((int)(vec).size()) ? "" : ", ");
  }
  os << "}";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& ma) {
  os << "{";
  int cnt = 0;
  for (auto x : ma) {
    cnt++;
    os << x.first << ": " << x.second
       << (cnt == ((int)(ma).size()) ? "" : ", ");
  }
  os << "}";
  return os;
}
typedef long long ll;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
bool check(ll x, ll b, ll p, ll k) {
  x %= k;
  if (x <= p) {
    return true;
  }
  ll a = ((b - x) + k - 1) / k;
  ll prex = x;
  x = (x + a * k) % b;
  if (x == prex) {
    return false;
  }
  if (x <= p) {
    return true;
  }
  check(x, k, p, x - prex);
}
long long core(ll a, ll b, ll c, ll d) {
  ll x;
  if (b > d) {
    cout << "No" << endl;
  } else if (a < b) {
    cout << "No" << endl;
  } else if (b <= c + 1) {
    cout << "Yes" << endl;
  } else {
    42;
    x = a;
    x -= (c + 1);
    x %= b;
    ll p = b - c - 1;
    42;
    if (d == b) {
      cout << "Yes" << endl;
      return 0;
    }
    if (x <= p) {
      cout << "No" << endl;
      return 0;
    }
    ll k = d % b;
    42;
    if (k <= p) {
      cout << "No" << endl;
      return 0;
    }
    42;
    if (check(x, b, p - 1, k)) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
long long solve() {
  long long t;
  cin >> t;
  ll a, b, c, d;
  for (long long i = 0; i < (long long)(t); i++) {
    cin >> a >> b >> c >> d;
    core(a, b, c, d);
  }
  return 0;
}
signed main() {
  solve();
  return 0;
}
