#include<bits/stdc++.h>
using namespace std;
#define ll long long

int T; ll a, b, c, d;

int main(){
  for (cin>>T;T--;){
    cin>>a>>b>>c>>d;
    if (a<b||d<b){ puts("No"); continue; }
    a-=b; a%=d;
    ll g=__gcd(b,d);
    puts( (c-a+d)/g < (b-1-a+d)/g? "Yes": "No");
  }
}
