using System;
using System.Linq;

namespace agc026_b
{
	class Program
	{
		public static long Gcd(long a, long b)
		{
			if (a < b)
				// 引数を入替えて自分を呼び出す
				return Gcd(b, a);
			while (b != 0)
			{
				var remainder = a % b;
				a = b;
				b = remainder;
			}
			return a;
		}
		static void Main(string[] args)
		{
			int t = int.Parse(Console.ReadLine());
			for (; t > 0; t--)
			{
				long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray();
				var gcd = Gcd(Gcd(x[0], x[1]), x[3]);
				Console.WriteLine(x[0] >= x[1]//初日がOKか
					&& (x[2] + gcd >= x[1] || x[3] % x[1] == 0) //最悪の場合を想定
					&& x[1] <= x[3] ? "Yes" : "No");//減り続けないか
			}
		}
	}
}