#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;
#define endl '\n'
// #define what_is(x) cerr << #x << " is " << x << endl;
#define ll long long
#define int long long
#define ld double
#define pii pair<int,int>
#define rand() abs((rand()<<15)|rand())
#define randll() abs(((long long)rand()<<30)|rand())
const int MOD = 1'000'000'007;

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long seed;
	asm("rdtsc" : "=A"(seed));
	srand(seed);

	int t;
	cin >> t;
	while(t--) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		if(b > a || d < b) {
			cout << "No" << endl;
			continue;
		}
		if(c >= b) {
			cout << "Yes" << endl;
			continue;
		}

		// cerr << a << " " << b << " " << c << " " << d << ": ";
		a -= ((a-c)/d)*d;
		if(a > c) a-=b;
		// cerr << a << " ";
		// cerr << a+d-b << "  ";
		int dif = d-((d/b)*b);
		// cerr << dif << "   ";
		if(dif!=0) {
			int temp = c/a;
			a += temp*(dif);
			// cerr << a << " ";
			while(a <= c)
				a+=dif;
			a-=b;
		}
		// cerr << a << "  ";
		cout << (a<0?"No":"Yes") << endl;
		// cerr << endl;
	}
}