#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <ext/pb_ds/priority_queue.hpp>
#define ll long long
#define MAXN 100005
using namespace std;
typedef pair<int,int> pii;
template <typename T>
inline void read(T& a)
{
	T ret(0),f(1);char ch(getchar());
	while(ch < '0' || ch > '9'){if(ch == '-') f = -1;ch = getchar();}
	while(ch >= '0' && ch <= '9'){ret = ret * 10 + (ch ^ 48);ch = getchar();}
	a = ret * f;
}
inline int Max(int x,int y){return x > y ? x : y;}
inline int Min(int x,int y){return x < y ? x : y;}
int main()
{
	int T;ll a,b,c,d,t,dd,l,r;
	read(T);
	while(T--)
	{
		read(a),read(b),read(c),read(d);
		if(a < b || b > d) printf("No\n");
		else if(c > b - 2) printf("Yes\n");
		else if(b == d)
		{
			if(a % b < c) printf("Yes\n");
			else printf("No\n");
		}
		else
		{
			t = (a - c) / b,dd = a - (t + 1) * b;
			t = d - b,l = (c - dd) / t,r = (b - dd) / t;
			printf("%s\n",l >= r ? "Yes" : "No");
		}
	}
	return 0;
}
