#include<cstdio>
#include<iostream>
#include<vector>
#include<numeric>
#include<algorithm>
#define IOS ios::sync_with_stdio(false),cin.tie(0)
typedef long long ll;
using namespace std;

int gcd(int m, int n)
{
	// 引数に０がある場合は０を返す
	if ((0 == m) || (0 == n))
		return 0;

	// ユークリッドの方法
	while (m != n)
	{
		if (m > n) m = m - n;
		else         n = n - m;
	}
	return m;
}

int main() {
	IOS;
	int i, T;
	cin >> T;
	ll a, b, c, d;
	for (i = 0; i < T; i++) {
		cin >> a >> b >> c >> d;
		ll k = a % b;
		if (k == 0)k = b;
		if (a < b || d < b || gcd(b,d) == 1) {
			cout << "No" << endl;
			continue;
		}
		if (c >= b) {
			cout << "Yes" << endl;
			continue;
		}
		
}