using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		long T = long.Parse(str);
		long[] A = new long[T];
		long[] B = new long[T];
		long[] C = new long[T];
		long[] D = new long[T];
		for(var i=0;i<T;i++){
			string[] str2 = Console.ReadLine().Split();
			A[i] = long.Parse(str2[0]);
			B[i] = long.Parse(str2[1]);
			C[i] = long.Parse(str2[2]);
			D[i] = long.Parse(str2[3]);
			string ans = "Yes";
			long a = A[i];
			while(true){
				a -= ((Math.Max((a - C[i]-1),0)/B[i])+1)*B[i];
				if(a<0){
					ans = "No";
					break;
				} else {
					if(D[i] < B[i]){
						ans = "No";
						break;
					} else if(D[i] == B[i]){
						break;
					} else {
						long at = ((C[i] - a)/(D[i] - B[i])+1)*(D[i] - B[i]);
						if(A[i]-(a+D[i]) >= 0 && ((A[i]-(a+D[i]))%(D[i] - B[i])==0)){
							break;
						} else if(a + at >= B[i] && ((A[i]-a)%(D[i] - B[i])==0)){
						//} else if(A[i]-(a+D[i]) >= 0 && ((A[i]-a)%(D[i] - B[i])==0)){
							break;
						} else {
							a += at;
							if(a==A[i] || a>=A[i]+B[i]){
								break;
							}
						}
					}
				}
			}
			Console.WriteLine(ans);
		}
	}
}