#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll T, a, b, c, d;
int main() {
	cin >> T;
	while (T--) {
		cin >> a >> b >> c >> d;
		if (d < b || a < b) {
			puts("No");
			continue;
		}
		if (c >= b) {
			puts("Yes");
			continue;
		}
		a -= a / b * b;
		if (a > c) {
			puts("No");
			continue;
		}
		d -= d / b * b;
		if (d == 0) {
			puts("Yes");
			continue;
		}
		ll t1 = c - a;
		ll t2 = b - a;
		ll g = __gcd(d, b);
		if (t1 / d * d + d < t2) 
			puts("No");
		else 
			puts("Yes");
	}
}