#include <stdio.h>

int main(void) {
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++){
		long long int a,b,c,d;
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
		if(b>a || b>d){
			printf("No\n");
			continue;
		}
		if(d==b || b-a==stock+d){
			printf("Yes\n");
			continue;
		}
		int stock=b%a;

		if((d%b)/(c-stock) != (d%b)/(b-stock)){
			printf("No");
			continue;
		}
		printf("Yes\n");
	}
	return 0;
}