#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
using namespace std;
bool num(long long a, long long b, long long c,long long d) {
	if (b > a)return false;
	if (b > d)return false;
	if (c >= b)return true;
	long long g = gcd(b, d);
	if (a - g + (a%g)>c) return false;
	else return true;
}
signed main()
{
	ios::sync_with_stdio(false);
	long long t, a, b, c, d;
	cin >> t;
	for (int i = 0; i < t; i++) {
		cin >> a >> b >> c >> d;
		if (num(a, b, c, d))cout << "Yes";
		else cout << "No";
	}
}