#include <iostream>
#include <string>
#include <numeric>
#include <limits>
#include <type_traits>
using namespace std;
 
int main() {
    unsigned long long t,a[300],b[300],c[300],d[300],x;
    cin >> t;
    for(int i=0;i<t;i++){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        x=a[i];
        if(b[i]>d[i] || a[i]<b[i]){
            cout << "No" << endl;
        } else if(b[i]<=c[i]){
            cout << "Yes" << endl;
        }else{
            bool f=1;
            for(unsigned long long j=c[i]+1;j<b[i];j++){
                if((a[i]-j)%gcd(b[i],d[i])==0){
                    cout << "No" << endl;
                    f=0;
                    break;
                }
            }
            if(f){
                cout << "Yes" << endl;
            }
        }
    }
}