#include <algorithm>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <ctime>
using namespace std;

#ifdef __APPLE__
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...)
#endif

const int N = (int)1e6 + 123;
const int MOD = (int)1e9 + 7;
const int inf = (int)5e8;
const long long infll = (long long)1e17;


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

    if (a < b) {
        cout << "No" << endl;
        return;
    }

    a -= b;

    if (b > d) {
        cout << "No" << endl;
        return;
    }

    if (b <= c || b == d) {
        cout << "Yes" << endl;
        return;
    }

    if (a > c) {
        a = a - ((a - c + b - 1) / b) * b;
    }

    long long step = d % b;

    long long to_go = (c - a)

    for (int i = 0; i <= 1e6; ++i) {
        a += d;
        long long to_go = (a - c + b - 1) / b;
        if (a - (to_go - 1) * b >= c && a - (to_go - 1) * b <= b - 1) {
            cout << "No" << endl;
            return;
        }
        a -= to_go * b;
    }

    cout << "Yes" << endl;
}

int main() {
#ifdef __APPLE__
#endif
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

