//InTheNameOfGod
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(i,j,k) for(int i=j;i<k;++i)
#define rrep(i,j,k) for(int i=j;i>=k;i--)
#define pb push_back
#define lb(i) i&(-i);
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int maxn =1;
ll t,a,b,c,d;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        if(a<b)
        {
            cout<<"No\n";
            continue;
        }
        if(d<b)
        {
            cout<<"No\n";
            continue;
        }
        if(b>c)
        {
            ll x=b-a%b-1;
            //cout<<x<<' '<<d%c<<' '<<x%(d%c)<<' ';
            if(a%b>c)
            {
                cout<<"No\n";
                continue;
            }
            if(d%b!=0&&x%(d%b)<b-c-1)
            {
                cout<<"No\n";
                continue;
            }
        }
        cout<<"Yes\n";
    }
    return 0;
}
