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

int main() {
	LL a,b,c,d;
	int T; cin>>T;
	while (T--) {
		cin>>a>>b>>c>>d;
		if (a<b) {
			puts("No");
			continue;
		}
		if (d<b) {
			puts("No");
			continue;
		}
		if (d==b) {
			int t=a%b;
			if (t>c) puts("No");
			else puts("Yes");
		}
		else {
			LL t=a%b;
			LL g=__gcd(b,d);
			//		cout<<g<<endl;
			if (b-c>g) puts("No");
			else puts("Yes");
		}
	}
}
