#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define N 1000005
using namespace std;
typedef long long ll;
ll n, a, b, c, d;

ll fe(ll a, ll us){
	if(us <= 1)
		return us*a + !us;
	ll t = fe(a, us/2);
	return (us%2) ? (t*t%b)*a%b : t*t%b;
}

int main() {
// 	freopen("in.txt", "r", stdin);
// 	freopen("out.txt", "w", stdout);
	scanf("%lld",&n);
	for(ll i = 1; i <= n; i++){
		scanf("%lld %lld %lld %lld",&a ,&b ,&c ,&d);
		if(a%b > c or a < b){
			printf("No\n");
			continue;
		}
		ll e = a%b + d;
		if(e%b > c or e < b){
			printf("No\n");
			continue;
		}
		ll e2 = e%b + d;
		if(e2%b > c or e2 < b){
			printf("No\n");
			continue;
		}
		ll art = (e2 - e + 2*b)%b;
		if(art == 0){
			printf("Yes\n");
			continue;
		}
		ll ilk = a%b;
		ll ger = b - ilk - 1;
		// ll k = ger/art;
		
// 		cout << a%b << " -> " << e%b << " -> " << e2%b << " = " << art << endl;
		ll crp = __gcd(b, art);
		art /= crp;
		b /= crp;
		ger /= crp;
		ll k = ger*fe(art, b - 2);
// 		cout << art*crp << " " << b*crp << endl;
// 		cout << ilk << " + " << k << "*" << art << endl;
		if((k*art*crp + ilk)%(b*crp) > c){
			printf("No\n");
			continue;
		}
		printf("Yes\n");
	}
	return 0;
}