#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define rep(i, a, b) for(int i = a; i < b; ++i)

int t, a, b, c, d;

bool inf() {
    int cur = a;
    for (int it = 15000; it--;) {
        if (cur < b) return 0;
        if (cur > b * 3) {
            cur = b + cur%b;
        }
        cur -= b;
        if (cur <= c) cur += d;
    }
    return 1;
}

main() {
    vector <int> ans;
    cin >> t;
    while (t--) {
        cin >> a >> b >> c >> d;
        ans.push_back(inf());
    }
    for (int i : ans) {
        puts(i ? "Yes" : "No");
    }
}