#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

#define ll long long
ll A,B,C,D;
bool check(ll a,ll b,ll c,ll d)
{
    int t=10000;
    ll now=a-b;
    if(now<0)return 0;
    while(t--)
    {
        if(now<=c) now+=d;
        //ll h=(now-c)%b+c;
        now=now-b;
        if(now<0) return 0;
    }
    return 1;
}
int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
        if(!check(A,B,C,D)){printf("No\n");}
        else
        {
            ll a;
            if(A<=C) a=A-B;
            else 
                a=min((A-C)%B+C,A-B);
            ll x=D%B;

            if(D<B) {printf("No\n");continue;}
            if(B<=C) {printf("Yes\n");continue;}
            if(x==0)
            {
                if(B>a&&C<a) printf("No\n");
                else printf("Yes\n");
                continue;
            }//cout<<a<<' '<<x<<endl;
            ll an1=(C-a)/x-10;
            an1=max(an1,0ll);
            ll an2=(B-a)/x+10;//cout<<an1<<' '<<an2<<' '<<x<<' '<<a<<endl;
            int fl=0;
            if(an2*x+a<=C) {printf("Yes\n");continue;}
            
            for(ll i=an1;i<=an2;i++)
            {
                if(a+i*x>C&&a+i*x<B)
                {
                    fl=1;
                    break;
                }
                if(a+i*x>=B) break;
            }
            if(fl==1) printf("No\n");
            else printf("Yes\n");
        }
    }
}