using System;
using System.Collections.Generic;
class Program{
	static void Main(){
		int s=int.Parse(Console.ReadLine());
		long[] arr;

		for(int i=0;i<s;i++){
			arr=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);

			if(arr[0]<arr[1]){Console.WriteLine("No");}
			else if(arr[1]>arr[3]){Console.WriteLine("No");}
			else if(arr[1]<=arr[2]+1){Console.WriteLine("Yes");}
			else if(arr[0]%arr[1]<=arr[2]&&arr[1]==arr[3]){Console.WriteLine("Yes");}
			else if(arr[0]%arr[1]>arr[2]){Console.WriteLine("No");}
			else{
				string t="Yes";

				long a=((arr[2]+1)-(arr[0]%arr[1]))%(arr[3]-arr[1]);
				if(a==0){t="No";}
				else{
					a=arr[2]+1+(arr[3]-arr[1])-a;
					if(a<arr[1]){t="No";}
				}
				Console.WriteLine(t);
			}
		}
	}
}