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

int n, m;

int main(){
	int i, flag;
	ll a, s, d, f, g, now;
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%lld %lld %lld %lld", &a, &s, &d, &f);
		flag = 1;
		if(a < s) flag = 0;
		a %= s; g = __gcd(s, f);
		if(s > f) flag = 0;
		if(a > d) flag = 0;
		if(d + 1 >= s){ printf("Yes\n"); continue; }
		now = s - (s - a) % g;
		if(g != s && now - g > d) flag = 0;
		if(flag) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}