#include<bits/stdc++.h>
using namespace std;
int main()
{
    int T;
    long long n,k,a,b;
    cin>>T;
    while(T--)
    {
        cin>>n>>a>>k>>b;
        if(a>b) printf("No\n");
        else if(a==b)
        {
            n%=a;
            if(k>=n) printf("Yes\n");
            else printf("No\n");
        }
        else
        {
            long long gcd=__gcd(a,b);
            n%=gcd;
            long long xuq=a-(gcd-n);
            if(xuq<=k) printf("Yes\n");
            else printf("No\n");
        }
    }
}
