//
// Created by Huang,Zhiqiang on 2018/7/16.
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

typedef long long ll;

typedef long long ll;
int n;
ll a,b,c,d;
ll gcd(ll x,ll y){
    if(y==0)
        return x;
    return gcd(y,x%y);
}
int main(){
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a >> b >> c >> d;
        if(a < b){
            cout << "No" << endl;
            continue;
        }
        if(b > d){
            cout << "No" << endl;
            continue;
        }
        if(c + 1 >= b){
            cout << "Yes" << endl;
            continue;
        }
        ll g = gcd(b,d);
        if((a-c-1ll)/g-(a-b)/g>0)
            cout << "No" << endl;
        else
            cout << "Yes" << endl;
    }
} }