#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Общий файл.
#include <ext/pb_ds/tree_policy.hpp> // Содержит класс tree_order_statistics_node_update


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;

#define pb push_back
#define fo(i, n) for(int i = 1; i <= n; ++i)

const int mod = 1e9 + 7;
const int N = 500500;
const int M = 10000;
const int inf = 2e9;

inline bool solve(ll a, ll b, ll c, ll d) {
    if(a < b) return 0;
    map<ll, ll> was;
    for(int i = 0; i < 100000; ++i) {
        if(a < b) return 0;
        a -= b;
        if(a <= c) a += d;
        if(was.count(a)) return 1;
        was[a] = 1;
    }
    return 1;
}
int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    ll t;
    cin >> t;
    while(t--) {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        bool ok = solve(a, b, c, d);
        if(ok) cout << "Yes\n";
        else cout << "No\n";
    }
    return 0;
}