#include<cstdio>
#include<vector>
using namespace std;
typedef long long LL;
LL A,B,C,D;
int time;
int main()
{
	int T;
	scanf("%d",&T);
	for(time=1;time<=T;time++)
	{
		bool f=0;
		scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
		if(A<B||D<B)
			f=1;
		for(int k=0;k<=500000;k++)
		{
			LL r=A+D*k;
			LL d=r%B;
			if(d>C||f)
			{
				printf("No\n");
				f=1;
				break;
			}
		}
		if(!f)
			printf("Yes\n");
	}
}