#include <bits/stdc++.h>
using namespace std;

int main() {
	int t; scanf("%d", &t);
	while (t--) {
		long long a, b, c, d; scanf("%I64d %I64d %I64d %I64d", &a, &b, &c, &d);
		if (a < b || d < b) cout << "No\n";
		else if (c >= b) cout << "Yes\n";
		else {
			long long x = a % b, y = __gcd(b, d);
			x += (b - 1 - x) / y * y;
			if (x > c) cout << "No\n";
			else cout << "Yes\n"; 
		}
	}
}