#include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
  return os;
}
lint gcd(lint a, lint b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    lint a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || b > a) {
      cout << "No\n";
      return 0;
    }
    if (b - 1 <= c) {
      cout << "Yes\n";
      return 0;
    }
    lint g = gcd(b, d);
    if (a % b + (b - 1 - a % b) / g * g <= c)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
