#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back

using namespace std;


ll T;
ll A, B , C , D;
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL); cout.tie(NULL);
        cin >> T;
        while(T--) {

                cin >> A >> B >> C >> D;
                if(A < B) {
                        cout << "No\n"; continue;
                }else if(D < B) {
                        cout << "No\n"; continue;
                }
                if(C >= B-1){
                        cout << "Yes\n"; continue;
                }
                ll L = C + 1;
                ll R = B - 1;
                L -= (A%B);
                R -= (A%B);
                L = (L + B)%B;
                R = (R + B)%B;
                if(L > R){
                        cout << "Yes\n"; continue;
                }
                ll g = __gcd(B,D);
                ll maxid = (B / g) - 1;
                ll yo = (L + g - 1) / g;
                //cout << g << " " << maxid << " " << L << " " << R << " " << yo << endl;
                if(yo * g > R) {
                        cout << "Yes\n"; continue;
                }
                if(yo > maxid) {
                        cout << "Yes\n"; continue;
                }
                cout << "No\n";
        }
        return 0;
}
