#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<stack>
using namespace std;
const int N=1e5+5;
typedef long long ll;
int T;
ll a,b,c,d;
int main()
{
	scanf("%d",&T);
	while(T--){
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
        if(a<b||d<b){
			puts("No");
        }
        else if(a%b>c){
			puts("No");
        }
        else if(c>=b){
            puts("Yes");
        }
        else{
            ll p=d-b;
            if(p==0){
				puts("Yes");
				continue ;
            }
            a=a%b;
            ll t=(c-a)/p+1;
            ll f=a+t*p;
            f=f-(f-c-1)/b*b;
            if(f<b){
				puts("No");
            }
            else{
				ll h=f-b;
				bool flag=true;
				while(h!=f-b){
					t=(c-h)/p+1;
					h=h+t*dd;
					h=h-(h-c-1)/b*b;
					if(h<b){
						puts("No");
						flag=false;
						break;
					}
					h-=b;
				}
				if(flag)
					puts("Yes");
            }
        }
	}
}
