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 {
					a += D[i];
					if(a==A[i] || a>=A[i]+B[i]){
						break;
					}
				}
			}
			Console.WriteLine(ans);
		}
	}
}