#include <stdio.h>
int main(void) {
	int t, i, k,x,y;
	float reft,reftd,r,tmp;
	scanf_s("%d", &t);
	long long  a[300], b[300], c[300], d[300];
	for (i = 0; i <= t-1; i++) {
		scanf_s("%d", &a[i]);
		scanf_s("%d", &b[i]);
		scanf_s("%d", &c[i]);
		scanf_s("%d", &d[i]);

	}

	for (i = 0; i <= t-1; i++) {
		if (a[i] < b[i]) printf("No\n");
		else if (b[i] > d[i]) printf("No\n");
		else if (b[i]-1 <= c[i]) printf("Yes\n");
		else {
			reft = a[i];
			while (reft >= b[i]) {
				reft = reft - b[i];
			}
			if (reft > c[i]) printf("No\n");
			else {
				reftd = d[i];
				while (reftd >= b[i]) {
					reftd = reftd - b[i];
				}
				y = reftd;
				x = b[i];
				
				r = x % y;
				while (r != 0) {
					x = y;
					y = r;
					r = x % y;
				}
				k = 0;
				while (reft >= b[i]) {
					if (c[i] < reft < b[i]) k++;
					else;
					reft = reft + y;
				}
				if (k >= 1) printf("No\n");
				else printf("Yes\n");

			}

		}

	}
	return 0;
}
