#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#include<set>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N
#define ll long long
#define db double
#define dbg1(x) cerr<<#x<<"="<<x<<" "
#define dbg2(x) cerr<<#x<<"="<<x<<"\n"
int T;ll a,b,c,d;
int main()
{
	for(scanf("%d",&T);T--;)
	{
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
		if(a<b) {puts("No");continue;}
		if(b>d) {puts("No");continue;}
		if(c>=b) {puts("Yes");continue;}
		a%=b,d%=b;
		if(a>c) {puts("No");continue;}
		ll g=std::__gcd(b,d);
		ll tmp=(ll)floor((b-a-1)*1./g);
		if(a+tmp*g>c) {puts("No");continue;}
		puts("Yes");
	}
	return 0;
}