#include <bits/stdc++.h>

#define int long long

using namespace std;

 main () {
	int t;
	cin >> t;
	while (t --) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		bool ok = 1;
		int it = 0;
		while (it <= 300000) {
			it ++;
			if (a < b) {
				ok = 0 ;
				break;
			}
			int x = max (1ll, (a - c) / b);
			a -= x * b;
			if (a < 0) {
				ok = 0;
				break;
			}
			if (a <= c) a += d;
		}
		if (ok) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}