/*input
38
9 7 5 9
9 7 6 9
14 10 7 12
14 10 8 12
14 10 9 12
14 10 7 11
14 10 8 11
14 10 9 11
9 10 5 10
10 10 5 10
11 10 5 10
16 10 5 10
1000000000000000000 17 14 999999999999999985
1000000000000000000 17 15 999999999999999985
1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1 4 2 3
1 4 3 2
2 1 3 4
2 1 4 3
2 3 1 4
2 3 4 1
2 4 1 3
2 4 3 1
3 1 2 4
3 1 4 2
3 2 1 4
3 2 4 1
3 4 1 2
3 4 2 1
4 1 2 3
4 1 3 2
4 2 1 3
4 2 3 1
4 3 1 2
4 3 2 1
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long T,a,b,c,d,ans;
	for(cin>>T;T--&&cin>>a>>b>>c>>d;cout<<(ans?"Yes\n":"No\n")){
		ans = 1, a-=b*max(0ll,(a-c-1)/b);
		if(a<b || d<b) ans = 0;
		if(d>b){
			if(c>=b-1) continue;
			__int128 diff=__gcd(d-b,b),low=0,high=(1ll<<18),mid;
			//cout<<int64_t(diff)<<'\n';
			while(low<high){
				mid = low+high>>1;
				if(a+mid*diff-b<=c) low = mid+1;
				else high = mid;
			}
			if(a+diff*low-b<b) ans = 0;
			// else if(a+diff*low-2*b != a%c)
			// 	ans = 0;
		}
	}
}