#include<bits/stdc++.h>
#define lf double
#define ll long long
#define ull unsigned ll
#define ii pair<int,int>
#define li pair<ll,int>
#define iii pair<ii,int>
#define iiii pair<ii,ii>
#define iiii2 pair<int,iii>
#define lii pair<ll,ii>
#define lolo pair<ll,ll>
#define heap priority_queue
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define all(x) x.begin(),x.end()
#define len(x) strlen(x)
#define sz(x) (int) x.size()
#define orta ((bas+son)/2)
#define min3(x,y,z) min(min(x,y),z)
#define max3(x,y,z) max(max(x,y),z)
#define umin(x,y) x=min(x,y)
#define umax(x,y) x=max(x,y)
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define MOD 998244353
#define inf 1000000001
#define N 100005
#define LOG 20
#define KOK 350
#define EPS 0.000000000001
#define pw(x) (1<<(x))
#define PI 3.1415926535
using namespace std;

int main() {

	#if 0

	freopen("input.txt","r",stdin);

	#endif

	int t;
	ll a,b,c,d;

	scanf("%d",&t);

	while(t--) {

		scanf("%lld %lld %lld %lld",&a,&b,&c,&d);

		if(b>a || b>d) {

			printf("No\n");

			continue ;

		}

		if(b<=c+1) {

			printf("Yes\n");

			continue ;

		}

		ll gcd=__gcd(b,d);

		a%=b;

		a%=gcd;

		b-=a;
		c-=a;

		c++;
		b--;

		ll dv1=c/gcd;
		ll dv2=b/gcd;

		if(dv1!=dv2 || !(b%gcd) || !(c%gcd)) printf("No\n");
		else printf("Yes\n");

	}

}