using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;


class Program {

	const long mod = 1000000007;
	//public static int[] max;

	static void Main(string[] args) {

		char[] cs = new char[] { ' ', ',' };
		//int val = int.Parse(Console.ReadLine());
		//int[] vals = parseAry(Console.ReadLine().Split(cs));
		//string str = Console.ReadLine();
		//string[] strs = Console.ReadLine().Split(cs);

		//string res="";
		//int res = 0; ;
		int t = int.Parse(Console.ReadLine());
		//string str = Console.ReadLine();
		//int[] vals = parseAry(Console.ReadLine().Split(cs));
		//int n = int.Parse(Console.ReadLine());

		//int num = vals[0];

		List<long[]> li = new List<long[]>();
		for ( int g = 0; g < t; g++ ) {

			long[] vals = parseAryL(Console.ReadLine().Split(cs));
			li.Add(vals);
		}


		int res = 0;		
		for ( int g = 0; g < li.Count; g++ ) {


			long[] vals = li[g];

			if ( vals[1] > vals[3] || vals[0] < vals[1] ) { Console.WriteLine("No"); continue; }
			long giri = vals[0]-(((vals[0]-vals[2]) / vals[1] +1)*vals[1]);
			if ( giri < 0 ) {
				if ( giri + vals[1] > vals[2] ) {
					Console.WriteLine("No"); continue;
				}
			}
			if ( vals[3] == vals[1] ) { Console.WriteLine("Yes"); continue; }
			long sa = vals[3] - vals[1];
			if ((( ( vals[2] - giri ) / sa + 1 ) * sa+giri) < vals[1]){
				Console.WriteLine("No"); continue;
			}

			Console.WriteLine("Yes");
		}



//		Console.WriteLine(res);

		return;
	}


	//　String[]  ----->  int[]
	static int[] parseAry(string[] str) {
		int[] nums = new int[str.Length];
		for (int i = 0; i < str.Length; i++) { nums[i] = int.Parse(str[i]); }
		return nums;
	}
	//　String[]  ----->  long[]
	static long[] parseAryL(string[] str) {
		long[] nums = new long[str.Length];
		for (int i = 0; i < str.Length; i++) { nums[i] = long.Parse(str[i]); }
		return nums;
	}
	
	//文字列を1文字ずつString[]に入れる
	static string[] strAry(String str) {
		string[] re = new string[str.Length];
		for (int i = 0; i < str.Length; i++) { re[i] = str[i].ToString(); }
		return re;
	}

}