#include <bits/stdc++.h>
#define long long long
using namespace std;

bool solve() {
    long a, b, c, d; cin >> a >> b >> c >> d;
    if(d < b) return false;
    if(a - b < 0) return false;
    if(c + 1 >= b) return true;
    if(d == b) {
        if(a % b > c) return false; 
        return true;
    }
    d -= b, a %= b;
    long l = c+1, r = b-1;
    if(r - l + 1 >= d) return false;
    if(__gcd(d, b) == 1) return false;
    a %= d, l %= d, r %= d;
    if(l <= r && l <= a) return false;
    if(r > l && (a >= l || a <= r)) return false;
    return true;
}

int main() {
    int T; scanf("%d", &T);
    while(T--) puts(solve() ? "Yes" : "No");
}
