//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#define FINAL_OUT(x) {cout << (x) << '\n'; exit(0); }

void solve()
{
    long long a,b,c,d;
    cin >> a >> b >> c >> d;

    if (b > a || b > d)
    {
        cout << "No\n";
        return;
    }

    if (c >= b)
    {
        cout << "Yes\n";
        return;
    }

    long long x = (a - c) / b;
    if (x > 0)
        a -= x * b;

    while (a > c)
        a -= b;

    if (a < 0)
    {
        cout << "No\n";
        return;
    }

    long long y = d % b;


    long long k = __gcd(b, y);
    long long step = (c - a) / k;
    a += step * k;
    for(int iter = 0; iter < 10; ++iter)
    {
        a += y;
        while (a > c)
            a -= b;


        if (a < 0)
        {
            cout << "No\n";
            return;
        }
    }

    cout << "Yes\n";
}

int main()
{
//    freopen("in.txt","r", stdin);
//    freopen("output.txt", "w", stdout);
//    cout << fixed << setprecision(10);
    ios_base::sync_with_stdio(false);

    int T;
    cin >> T;
    while (T--)
        solve();

}
