#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vii = vector<ii>;
using vvii = vector<vii>;

template<class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template<class TIn, class TOut = null_type>
using order_tree = tree<TIn, TOut, less<TIn>, rb_tree_tag,
	tree_order_statistics_node_update>;

constexpr int INF = 2000000010;
constexpr ll LLINF = 9000000000000000010LL;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	int T;
	cin >> T;
	while (T--) {
		ll A, B, C, D;
		cin >> A >> B >> C >> D;

		if (D < B || A < B) { cout << "No\n"; continue; }
		if (D == B) { cout << (A % B <= C ? "Yes\n" : "No\n"); continue; }

		A -= B * (max(0LL, A - C + B - 1LL) / B);

		bool ok = true;
		for (int i = 0; ok && i < 1000; ++i) {
			ok = ok && A >= 0LL;
			ll st = (C + 1LL - A + (D - B) - 1LL) / (D - B);
			A += st * (D - B) - B;
		}
		cout << (ok ? "Yes\n" : "No\n");
	}
	
	return 0;
}
