#include <bits/stdc++.h>
#define pb push_back
typedef long long ll;
using namespace std;
ll T;
ll steps;
ll solve(ll a , ll b , ll c , ll d)
{
        /*if(steps > 100010) {
                return 1;
        }
        if(a < b) return 0;
        steps += 1;
        //cout << a << " " << b << " " << c << " " << d << endl;
        ll hm = (a - c - 1) / b;
        hm = max(hm , 0LL);
        ll aa = a - hm*b;
        if(aa < b) return 0;
        return solve(aa - b + d , b , c , d);*/
        /*for(steps = 0 ; steps <= 1000100; steps++) {
                if(a < b) return 0;
                ll hm = (a - c - 1) / b;
        hm = max(hm , 0LL);
        ll aa = a - hm*b;
        if(aa < b) return 0;
        a = aa - b + d;
        }
        return 1;*/
        if(b <= c+1) {
                if(d < b) return 0;
                return 1;
        }
        if((a%b) > c) return 0;
        ll ddd = d;
        d = d%b;
        if(d == 0) return 1;
        ll g = __gcd(b , d);
        if(g == 1) return 0;
        ll mup = b / g;
        mup--;
        if(((mup%b)*(d%b))%b > c) return 0;
        cout << "Ayy\n";
        if(ddd < b) return 0;
        return 1;

}
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        cin >> T;
        while(T--) {

                ll A , B , C , D;
                cin >> A >> B >> C >> D;
                if(C + D < B) {
                        cout << "No\n"; continue;
                }else if(A < B) {
                        cout << "No\n"; continue;
                }
                steps = 0;
                ll ans = solve(A , B , C , D);
                ans == 1 ? cout << "Yes\n" : cout << "No\n";
        }
        return 0;
}
