/*
ID: yzshang1
LANG: C++11
TASK:
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define pb push_back
#define mp make_pair
#define lsh(i) (1 << (i))
#define lshll(i) (1LL << (i))
#define repn(i, n) for (int (i) = 1; (i) <= (int)n; (i)++)
#define rep(i, n) for (int (i) = 0; (i) < (int)n; (i)++)
const int INF = 0x3f3f3f3f;
const long double EPS = 1e-6;
LL getMod(LL a, LL b) {
	return (a + 1000000000000LL * b) % b;
}
int main() {
	int T; cin >> T;
	while (T--) {
		LL a, b, c, d;
		cin >> a >> b >> c >> d;
	//	int st = clock();
		if (b > a) {
			cout << "No" << endl;
			continue;
		}
		else if (b > d) {
			cout << "No" << endl;
			continue;
		}
		else if (c >= b) {
			cout << "Yes" << endl;
			continue;
		}
		LL mod = __gcd(b, d);
		LL x, aa = getMod(a, mod);
		for (x = c - b + 1 ;; x++) if (getMod(x, mod) == aa) break;
	//	cerr << x << endl;
		if (x < 0) cout << "No" << endl; else cout << "Yes" << endl;
	}
	return 0;
}
