#include <iostream>
using namespace std;

bool log[1000000000000000000]

bool func()
{
  long a,b,c,d,ch;
  cin >> a >> b >> c >> d;
  if(a<b)return false;
  if(b>d)return false;
  if(b<=d&&b<=c)return true;
  ch=b;
  if(ch>c+1)ch = c+1;
  //bool *log=new bool[ch];
  for(int i=0;i<ch;i++)log[i]=false;
  while(true)
  {
    ch=a%b;
    if(ch==a)return false;//{delete[] log;return false;}
    a=ch;
    if(a>c)return false;//{delete[] log;return false;}
    if(log[a])return true;//{delete[] log;return true;}
    log[a]=true;
    a+=d;
  }
}

void ans(bool ans)
{
  if(ans)cout << "Yes\n";
  else cout << "No\n";
}

int main()
{
  int n;
  cin >> n;
  for(int i=0;i<n;i++)ans(func());
}
