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