#include<bits/stdc++.h>
using namespace std;
typedef long long l;
int main(){
    l t;
    cin>>t;
    l a[t],b[t],c[t],d[t],e[t];
    for(l i=0;i<t;i++){
        cin>>a[i]>>b[i]>>c[i]>>d[i];
        e[i]=a[i];
        while(1){
            if(a[i]>c[i]) a[i]-=((a[i]-c[i]-1)/b[i]+1)*b[i];
            else a[i]-=c[i];
            if(a[i]<0){
                cout<<"No"<<endl;
                break;
            }
            else a[i]+=d[i];
            if(a[i]==e[i]){
                cout<<"Yes"<<endl;
                break;
            }
    }
    return 0;
}
    