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

void appleJuice(int a, int b, int c, int d){
  int A = a;
  for(int k = 0; k < 1000001; k++){
    A -= b;
    if(k < 1000000){
      if(A > c){
        A -= b;
        if(A < 0){
          cout << "No" << endl;
          return;
        }
      }
      else{
        A += d;
      }
    }
    else{
      if(A > c){
        cout << "Yes" << endl;
        return;
      }
      else{
        cout << "No" << endl
        return;
      }
    }
    
  }
}


int main() {
  int T, a, b, c, d;

  cin >> T;
  for(int j = 0; j < T; j++){ //T行で実行
    cin >> a >> b >> c >> d;

    appleJuice(a, b, c, d);
  }
  